Ignoring blank cells in a formula

ftzamar

New Member
Joined
May 29, 2018
Messages
1
This is the formula I am using in my spreadsheet. The column the formula is looking at does include zeros as a value, but the formula as written includes the blank cells as a zero, which it should not. I need to exclude those.

Here is the formula:

=IF(AND(I3>=0,I3<=5),"<=5%",IF(AND(I3>=6,I3<=10),"6-10%",IF(AND(I3>=11,I3<=25),"11-25%",IF(AND(I3>=26,I3<=50),"26-50%",IF(AND(I3>=51,I3<=75),"51-75%",IF(I3>75,">75",""))))))

How do I add to this to exclude the blank cells

Thanks.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
You've left out the percentage in the ">75" result.

You can replace your somewhat lengthy formula with this

=LOOKUP(I3,{0,6,11,26,51,75},{"<=5%","6-10%","11-25%","26-50%","51-75%",">75%"})

and if you want to exclude blank cells

=IF(I3="","",LOOKUP(I3,{0,6,11,26,51,75},{"<=5%","6-10%","11-25%","26-50%","51-75%",">75%"}))
 
Last edited:
Upvote 0
Welcome to the Board!

You can exclude blank cells by using the LEN function, i.e.
Code:
LEN(I3)>0
or by checking for the empty string, i.e.
Code:
I3<>""
Place in your formula where desired.
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,632
Latest member
jladair

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
Back
Top