Compute the first digit of an integer in Excel

0

I have a spreadsheet with column B having integers. I want to get the first digit of each entry in column B in the corresponding row of column C.

Dvizma Sinha

Posted 2012-07-13T14:29:13.393

Reputation: 1

By integers, do you mean there are some negative values? – Excellll – 2012-07-14T04:35:22.093

Answers

3

If you want them as numbers for calculation to be done

=VALUE(LEFT(B1,1))

drag that down in Column C else

=LEFT(B1,1)

datatoo

Posted 2012-07-13T14:29:13.393

Reputation: 3 162

1

To build on @datatoo's answer, if your list includes negative values, you'll have to add a condition to look past any negative signs:

=VALUE(IF(B1<0,MID(B1,2,1),LEFT(B1,1)))

Excellll

Posted 2012-07-13T14:29:13.393

Reputation: 11 857

1you COULD just take the absolute value of the cell first. abs() – lornix – 2012-07-14T20:10:16.247

@lornix Or that.... :P – Excellll – 2012-07-15T04:59:50.173