mardi 1 juin 2021

Problem using the Len function in defining a condition in Excel

I want to give a two-column Excel file as input to my script. But I need a two-column Excel file to have one feature: the second column must have 10 characters. Because the number of rows in the Excel file is large, I can not manually edit every cell in the second column. So I need to put a control function in Excel to check the second column, so that it counts the number of characters in each cell in the second column and adds zero to the right of it, which is less than ten characters.

Based on my search, I realized that I could use the definition of the condition and the Len function, but the output was not what I wanted.

 Full ID       Expected Result
  15               0000000015
  159              0000000159
  16               0000000016
  43               0000000043
  4329             0000004329

What I had tried :

=Right(A2,LEN(A2)+8)

but it was wrong.

How can I get my expected results in like the top example?

Aucun commentaire:

Enregistrer un commentaire