How do I fit IF(ISBLANK) into these formulas?

slam

Well-known Member
Joined
Sep 16, 2002
Messages
919
Office Version
  1. 365
  2. 2019
So I’ve got my spreadsheet functioning as I want in terms of results, but I need to tweak some formulas to account for blank cells so I don’t get #N/A errors. I’ve done this many times before with simpler formulas using =IF(ISBLANK()…. But am not sure how to apply it to some of the more complex formulas I’m using. I’ll just give you a couple, and hopefully I’ll figure out how to apply it to the other formulas with different functions etc.

=INDEX(Australia!$B$2:$B$17,MATCH(MIN(Australia!$G$2:$G$17),Australia!$G$2:$G$17,0))

=VLOOKUP($B3,Australia!$B$2:$H$17,7,FALSE)

In both formulas, there may or may not be data on the cells referenced on the Australia worksheet. How do I fit in the IF(ISBLANK() to them?

Thanks
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
So I’ve got my spreadsheet functioning as I want in terms of results, but I need to tweak some formulas to account for blank cells so I don’t get #N/A errors. I’ve done this many times before with simpler formulas using =IF(ISBLANK()…. But am not sure how to apply it to some of the more complex formulas I’m using. I’ll just give you a couple, and hopefully I’ll figure out how to apply it to the other formulas with different functions etc.

=INDEX(Australia!$B$2:$B$17,MATCH(MIN(Australia!$G$2:$G$17),Australia!$G$2:$G$17,0))

=VLOOKUP($B3,Australia!$B$2:$H$17,7,FALSE)

In both formulas, there may or may not be data on the cells referenced on the Australia worksheet. How do I fit in the IF(ISBLANK() to them?

Thanks
Error trapping is easier in Excel versions 2007 and later.

What version of Excel are you using?
 
Upvote 0
2003 unfortunately. I have no control over upgrading - at work....
OK, for the INDEX formula we can test to make sure there are numbers in the range like this:

=IF(COUNT(Australia!$G$2:$G$17),INDEX(Australia!$B$2:$B$17,MATCH(MIN(Australia!$G$2:$G$17),Australia!$G$2:$G$17,0)),"")

And for the VLOOKUP, we can do this:

=IF(ISNA(VLOOKUP($B3,Australia!$B$2:$H$17,7,0)),"",VLOOKUP($B3,Australia!$B$2:$H$17,7,0))

As you can see, we're repeating the VLOOKUP portion of the formula. This isn't very efficient. If the value to be returned is TEXT this version is a bit more efficient:

=LOOKUP("zzzzz",CHOOSE({1,2},"",VLOOKUP($B3,Australia!$B$2:$H$17,7,0)))
 
Last edited:
Upvote 0
OK, for the INDEX formula we can test to make sure there are numbers in the range like this:

=IF(COUNT(Australia!$G$2:$G$17),INDEX(Australia!$B$2:$B$17,MATCH(MIN(Australia!$G$2:$G$17),Australia!$G$2:$G$17,0)),"")

And for the VLOOKUP, we can do this:

=IF(ISNA(VLOOKUP($B3,Australia!$B$2:$H$17,7,0)),"",VLOOKUP($B3,Australia!$B$2:$H$17,7,0))

As you can see, we're repeating the VLOOKUP portion of the formula. This isn't very efficient. If the value to be returned is TEXT this version is a bit more efficient:

=LOOKUP("zzzzz",CHOOSE({1,2},"",VLOOKUP($B3,Australia!$B$2:$H$17,7,0)))

Excellent, thank you! Could be a mix of text or numbers for the 2nd one, so I went with your first formula. Thanks again!
 
Upvote 0

Forum statistics

Threads
1,224,525
Messages
6,179,314
Members
452,905
Latest member
deadwings

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