Show text if formula result = 0

sharky12345

Well-known Member
Joined
Aug 5, 2010
Messages
3,422
Office Version
  1. 2016
Platform
  1. Windows
I've got the following formula which works fine, but I need it to show the text "NIL FOUND" if the columns checked result in a formula result of zero, (i.e. no maximum value).

Can anyone help?

=IFERROR(INDEX($N$7:$Q$7,0,MATCH(MAX($N7:$Q8),$N8:$Q8,0)),"")
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Not tried but will it not go in an if statement

=IF(FERROR(INDEX($N$7:$Q$7,0,MATCH(MAX($N7:$Q8),$N8:$Q8,0)),"") =0,"NIL FOUND",
IFERROR(INDEX($N$7:$Q$7,0,MATCH(MAX($N7:$Q8),$N8:$Q8,0)),"") )
<strike></strike>
 
Upvote 0
That doesn't work I'm afraid - it produces '#NAME?'

Not sure if this makes a difference but I can explain a little further - I need it to show that text if there is no 'MAX' value because all of the evaluated cells are zero.
 
Last edited:
Upvote 0
sharky,

the error is due to the spelling mistake, see this

=IF(IFERROR(INDEX($N$7:$Q$7,0,MATCH(MAX($N7:$Q8),$N8:$Q8,0)),"") =0,"NIL FOUND",
IFERROR(INDEX($N$7:$Q$7,0,MATCH(MAX($N7:$Q8),$N8:$Q8,0)),"") )
 
Upvote 0
I've got the following formula which works fine, but I need it to show the text "NIL FOUND" if the columns checked result in a formula result of zero, (i.e. no maximum value).

Can anyone help?

1. A max value can have multiple instances. The formula you have can just produce a result for the first instance it comes across.

2. That the max value must be above 0, try...

=IF(ISNUMBER(1/MAX($N8:$Q8)),INDEX($N$7:$Q$7,MATCH(MAX(
$N8:$Q8
),
$N8:$Q8
,0)),"NIL FOUND")

Note the correction involving the max range.
 
Upvote 0
Guys - got it working, thanks to all who have taken the trouble to reply!
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,316
Members
452,634
Latest member
cpostell

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