Excel - Digits per column management

Anonymous
2022-07-25T12:11:30+00:00

Hello,

I am processing a file in Excel and I need to make some modifications in a specific column.

More precisely, this particular column contains either 8 digit or 9 digit numbers.

I would like to know, whether there is a way, to enter a function, that would read the content of each cell and if it reads a 9digit number to do nothing with it, but if it reads an 8digit number to add a 0 in front of it?

Thank you in advance, for any answer.

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2022-07-25T12:26:58+00:00

    Re: "if it reads an 8 digit number to add a 0 in front of it"

    A "number" with a leading 0 is not a number in Excel, it is text...

    Image

    Text aligns to the left side, numbers align to the right.

    =IF(LEN(B2)=8, "0"& B2, B2)

    '---
    Nothing Left to Lose

    https://1drv.ms/u/s!Au8Lyt79SOuhZw2MCH7_7MuLj04?e=sAwbHU

    (free excel programs)

    0 comments No comments
  2. Anonymous
    2022-07-25T13:20:19+00:00

    Hi there

    If the column contains real numbers then we can simply custom format the column as "000000000"

    i.e. "Nine consecutive zeroes"

    And the results will be similar to the picture below.

    Image

    If you still looking for a formula solution then try the formula =TEXT(A1,"000000000")

    But the result of this formula is a Text string (not a real Number) so you'll not be able to do calculations with them.

    Image

    I hope this helps you and gives a solution to your problem

    Do let me know if you need more help

    Regards

    Jeovany

    0 comments No comments