IF + OR + ISERROR Logic doesn't seem to work

ivancans

New Member
Joined
Feb 7, 2017
Messages
6
Hi guys,

Please explain me what am I doing wrong with the following situation:

I have two tables, in both tables I have sim card numbers and according contact addresses. The reason why I need two tables is that in one of those tables, addresses are more fresh but the problem is that not every sim card number has the more fresh address therefore I have to use less fresh address or the address from first table. Because VLOOKUP would give me either: address from the fresh table, zero as there is no address indicated for that number or N/A as sim card numbers may very well be only in one table I have written this formula that does not work:

[TABLE="width: 259"]
<tbody>[TR]
[TD="width: 259"] =IF(OR(VLOOKUP(sim_number;fresh_table;2;0)=0;ISERROR(VLOOKUP(sim_number;fresh_table;2;0)));value from old table;VLOOKUP(A2;fresh_table;2;0))

Evaluating the formula I can see that the problem technically is with the fact that OR statement takes N/A as the results and therefore IF statement doesn't understand what to do and gives yet another N/A but I don't get it why this happens if I have an OR statement that needs only one TRUE value and even if both of those values would be FALSE then IF statement would go further, to the part of "if not true".

I would really appreciate the help[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hi guys,

Please explain me what am I doing wrong with the following situation:

I have two tables, in both tables I have sim card numbers and according contact addresses. The reason why I need two tables is that in one of those tables, addresses are more fresh but the problem is that not every sim card number has the more fresh address therefore I have to use less fresh address or the address from first table. Because VLOOKUP would give me either: address from the fresh table, zero as there is no address indicated for that number or N/A as sim card numbers may very well be only in one table I have written this formula that does not work:

[TABLE="width: 259"]
<tbody>[TR]
[TD="width: 259"] =IF(OR(VLOOKUP(sim_number;fresh_table;2;0)=0;ISERROR(VLOOKUP(sim_number;fresh_table;2;0)));value from old table;VLOOKUP(A2;fresh_table;2;0))

Evaluating the formula I can see that the problem technically is with the fact that OR statement takes N/A as the results and therefore IF statement doesn't understand what to do and gives yet another N/A but I don't get it why this happens if I have an OR statement that needs only one TRUE value and even if both of those values would be FALSE then IF statement would go further, to the part of "if not true".

I would really appreciate the help[/TD]
[/TR]
</tbody>[/TABLE]

=IF(IFERROR(VLOOKUP(sim_number;fresh_table;2;0);"")="";value from old table;VLOOKUP(A2;fresh_table;2;0))
 
Upvote 0

Forum statistics

Threads
1,223,958
Messages
6,175,642
Members
452,663
Latest member
MEMEH

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