Discussion Locked

Execel and Regular Expressions

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have an excel spreadsheet in which the first column of every row contains a 8 digit number. I would like to somehow auto-populate the last column of each row with the first digit of the number in the first column in that row. Is this possible, if so, how? I was thinking of regular expressions, but I don't know if those are applicable in Excel.

3 replies

by chitosunday

to get the first number in cell a1 the formula is
=left(a1,1) then copy paste it down to your last row

by maru3445

Worked like a charm, thanks. Let me ask you this though, this excel file will be updated on a regular basis, but I don't want to have to copy and paste the formula each time. If I know column A will be the number each time, and column C needs to be the first digit of the data in column A each time, is there anyway to apply this formula to colmun C globally?

by dryflies

when a cell is selected there is a small square in the lower right corner. drag that square down to the extent of your spreadsheet to copy the formula all the way down. Note, even though nothing will be visible for rows that do not have column a populated, excel will print any page that has the formula pasted into it. For that reason I only prefill as far as I need for the session.
please rate my answer

This discussion is closed to new replies.