Return a blank result from an empty source record

Brew

Well-known Member
Joined
Sep 29, 2003
Messages
1,569
How do I update the following formula so that if c3 is a empty cell, then the result is blank
=IF(OR(C3=0,C3=5),1,IF(OR(C3=1,C3=6),2,IF(OR(C3=2,C3=7),3,IF(OR(C3=3,C3=8),4,IF(OR(C3=4,C3=9),5,"NONE OF THESE")))))
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
=IF(ISNUMBER(C3)*(C3>=0),LOOKUP(IF(C3>=5,C3-5,C3),{0,1;1,2;2,3;3,4;5,"NONE OF 0 to 9"}),"")
 

Brew

Well-known Member
Joined
Sep 29, 2003
Messages
1,569

ADVERTISEMENT

Great thanks everyone!......Aladin, im using your solution...Thanks again
 

Brew

Well-known Member
Joined
Sep 29, 2003
Messages
1,569
Aladin, i tested your solution and it does go blank, but it doesnt give me the desired result as my original formula:
I have taken out the none of these for 5-9, because it will never occur in my records
=IF(OR(C3=0,C3=5),1,IF(OR(C3=1,C3=6),2,IF(OR(C3=2,C3=7),3,IF(OR(C3=3,C3=8),4,IF(OR(C3=4,C3=9),5))))))
Also, I tried added isblank in this way, but it gives me an () error:
=IF(ISBLANK,(IF(OR(C3=0,C3=5),1,IF(OR(C3=1,C3=6),2,IF(OR(C3=2,C3=7),3,IF(OR(C3=3,C3=8),4,IF(OR(C3=4,C3=9),5))))))

however, Fawlty1's solution gave me the desired result.
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
Aladin, i tested your solution and it does go blank, but it doesnt give me the desired result as my original formula:
...

With which value of C3 doesn't give you the desired result?
 

Forum statistics

Threads
1,136,709
Messages
5,677,324
Members
419,688
Latest member
sarahmichelle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top