Hi,
Thanks in advance for your help!
I am trying to write a formula so that:
if J9<10, display 00000
if J9 is between 10 and 99, display 0000
if J9 is 100-999, display 000
if J9 is 1000-9999, display 00
if J9 is 10000-99999, display 0
if J9>99999, the cell is blank (Note, it will be okay if this last one is not possible)
So far I have IF(AND(J9>9,J9<100),"0000","000")
So it works for numbers between 10-999 right now.
Can anyone tell me how to do this? I really appreciate your time and help!
Last edited by NBVC; 04-02-2009 at 03:44 PM.
Try this:
HTH=IF(J9<10,"00000",IF(AND(10<=J9,J9<=99),"0000",IF(AND(100<=J9,J9<=999),"000",IF(AND(1000<=J9,J9<=9999),"00",IF(AND(10000<=J9,J9<=99999),"0","")))))
“To sin by silence when they should protest makes cowards of men.” ~ Abraham Lincoln
Try:
=LOOKUP(J9,{0,10,100,1000,10000,100000},{"00000","0000","000","00","0",""})
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
=choose(len(j9),"00000","0000","000","00","0","",)
"Unless otherwise stated all my comments are directed at OP"
Mojito connoisseur and a dabbler in Cisco
where does code go ?
look here
how to insert code
how to enter array formula
why use -- in sumproduct
recommended reading
wiki Mojito
how to say no convincingly
most important thing you need
Martin Wilson: SPV
and RSMBC
Thank you ConneXionLost and NBVC for your replies
I tried ConneXionLost's formula and it worked perfectly. I have been trying to figure this out for awhile and I am so happy to have it done!
Thanks again for taking the time to reply.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks