ISERROR within an OR statement with an IF statement

BulletOLB

New Member
Joined
Oct 4, 2011
Messages
2
Hello and thank you for any help. I am trying to perform a vlookup, nested with an if statement. I am very familiar with this basic process. My problem however arrises when I try to use an OR statement as the first condition within the IF statement. Essentially what I am trying to ask excel to do is..."If you find an error OR a 0 in cell Y35, perform this vlookup statement, else return the value in cell Y35" I have had success performing this process when just using the ISERROR statement as the first condition in the IF statement and when using just the =0 condition, but I have not been able to get both of them to work at the same time. Here is what my formula looks like currently but it does not work.

=IF(OR(ISERROR(Y35),Y35=0),VLOOKUP(R35,'Volume Table'!$A$1:$B$60,2,FALSE)/S35,Y35)

I have done my best to describe this so if you need further details let me know. Thanks
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
This happens because excel calculates everything inside the OR before giving it`s results. So, if Y35 is an error, the "Y35=0" comparison will end up in an error, messing with the whole formula. Try this longer version:
=IF(ISERROR(Y35),VLOOKUP(R35,'Volume Table'!$A$1:$B$60,2,FALSE)/S35,if(Y35=0,VLOOKUP(R35,'Volume Table'!$A$1:$B$60,2,FALSE)/S35,Y35))
 
Upvote 0
Hello and thank you for any help. I am trying to perform a vlookup, nested with an if statement. I am very familiar with this basic process. My problem however arrises when I try to use an OR statement as the first condition within the IF statement. Essentially what I am trying to ask excel to do is..."If you find an error OR a 0 in cell Y35, perform this vlookup statement, else return the value in cell Y35" I have had success performing this process when just using the ISERROR statement as the first condition in the IF statement and when using just the =0 condition, but I have not been able to get both of them to work at the same time. Here is what my formula looks like currently but it does not work.

=IF(OR(ISERROR(Y35),Y35=0),VLOOKUP(R35,'Volume Table'!$A$1:$B$60,2,FALSE)/S35,Y35)

I have done my best to describe this so if you need further details let me know. Thanks
Try rather..

=IF(ISERROR(1/Y35),VLOOKUP(R35,'Volume Table'!$A$1:$B$60,2,0)/S35,Y35)

for, when there is an error value in Y35, OR will end up in error because of the 2nd term, never in TRUE.
 
Upvote 0
Welcome to the board...

You have to isolate the error in it's own IF (not in an OR or other function)
Because If Y35 IS an error, the ISERROR part is true,
But the OR MUST still test if Y35=0, and that results in an error.

Try

=IF(LOOKUP(9.99999999999999E+307,CHOOSE({1,2},0,Y35))=0,VLOOKUP(R35,'Volume Table'!$A$1:$B$60,2,FALSE)/S35,Y35)
 
Upvote 0
Thank you for the prompt help, these posts cleared up my issue right away! Couldn't have done it without your help. Have a good one.
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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