Help Plese.

B

Bubu

What formula should i write in cell("B1") to have from cell("A1")
the 6th digit and the 5th digit left to right, if they both exist,
like ..."

Cell("A1")
123456
Cell("B1")
"12"


otherwise if only the 5th digit exist i should have
"01" "02" "03" "04" "05" "06" "07" "08" "09"

Cell("A1")
12345
Cell("B1")
"01"

if there is not 5th and not 6th
"00"

Cell("A1")
1234
Cell("B1")
"00"

or

Cell("A1")
123
Cell("B1")
"00"


I don't want to use vba and i want to keep cell format general.



Many Thanks, Best Regards.

Robert.
 
F

Frank Kabel

Hi
one way
=IF(LEN(A1)>=6,MID(A1,6,1)&MID(A1,5,1),IF(LEN(A1)=5,"0" &
RIGHT(A1,1),"00"))
 

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

Top