Nested if or function

drluke

Active Member
Joined
Apr 17, 2014
Messages
314
Office Version
  1. 365
Platform
  1. Windows
I have a nested IF OR formula, but both of the criteria to evaluate has the same result. My formula is:

[TABLE="width: 48"]
<colgroup><col width="64" style="width: 48pt;"> <tbody>[TR]
[TD="width: 64, bgcolor: transparent"][TABLE="width: 1113"]
<colgroup><col width="64" style="width: 48pt;"> <col width="76" style="width: 57pt; mso-width-source: userset; mso-width-alt: 2779;"> <col width="62" style="width: 47pt; mso-width-source: userset; mso-width-alt: 2267;"> <col width="64" style="width: 48pt;" span="2"> <col width="77" style="width: 58pt; mso-width-source: userset; mso-width-alt: 2816;"> <col width="64" style="width: 48pt;" span="3"> <col width="55" style="width: 41pt; mso-width-source: userset; mso-width-alt: 2011;"> <col width="64" style="width: 48pt;"> <col width="101" style="width: 76pt; mso-width-source: userset; mso-width-alt: 3693;"> <col width="64" style="width: 48pt;" span="6"> <col width="152" style="width: 114pt; mso-width-source: userset; mso-width-alt: 5558;"> <col width="64" style="width: 48pt;" span="2"> <tbody>[TR]
[TD="width: 1483, bgcolor: transparent, colspan: 21"]=IF(OR($A$4<>"D",$A$4=$D$3),IF(INDEX(DATA!$A$11:$P$89,MATCH($A76,DATA!$A$11:$A$89,0),1)=$A76,OFFSET(DATA!$P80,0,
(-DATA!$P$8)),"Error"),IF(INDEX(DATA!$A$11:$P$89,MATCH($A76,DATA!$A$11:$A$89,0),1)=$A76,OFFSET(DATA!$P80,0,(-DATA!$P$8))
,"Error"))

[/TD]
[/TR]
</tbody>[/TABLE]

The formula works ok, but as both options for A4 has the same result, is there a way I can shorten this formula and
make it less complex?
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Hi,

You don't need the duplicated 2nd half of the formula, try it like this:

=IF(OR($A$4<>"D",$A$4=$D$3),IF(INDEX(DATA!$A$11:$P$89,MATCH($A76,DATA!$A$11:$A$89,0),1)=$A76,OFFSET(DATA!$P80,0,(-DATA!$P$8)),"Error"),"Error")
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

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