How to set the value?

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

Does anyone have any suggestions on how to set the value using Indirect
function?
I would like to change the 4- digit + .HK, the maximum digit is 4-digit.

There is a given number 5 in cell A1, it should return 0005.HK. in cell B1
There is a given number 941 cell A1, it should return 0941.HK in cell B1
There is a given number 2388 cell A1, it should return 2388.HK in cell B1

Does anyone have any suggestions on how to do it?
Thanks in advance for any suggestions
Eric
 
Im not sure of the Indirect way but this will wor
=IF(LEN(A1)=1,"000"&TEXT(A1,0)&".HK.",IF(LEN(A1)=2,"00"&TEXT(A1,0)&".HK.",IF(LEN(A1)=3,"0"&TEXT(A1,0)&".HK.",IF(LEN(A1)=4,TEXT(A1,0)&".HK.",""))))
 
in an adjacent column/row:

=REPT("0";4-LEN(A1))&".HK"

then copy->pastespecial as values
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top