Nested Ifs

questforexcel

Board Regular
Joined
Jan 18, 2019
Messages
128
Office Version
  1. 2013
Platform
  1. Windows
Hi All,

My Apologies, I am not able to download external content so would not be able to show my sheet or calculations. Will try my best to explain what I am trying to achieve and would appreciate your help.

I need to highlight variance across two data sets. Data columns are identical in the two sets.

I need two check two conditions within one formula. First, two check if one name is present in the other table. I have done that using the below formula

=IF(COUNTIF('Current Month data '!$A$2:$A$243,'Prior Month data'!$A176),"",'Prior Month data'!$A176)

Second, each of these names are assigned a value ranging from 0-1. I need to check if the counts in these two data sets are identical. I have done that using this formula :

=IF(VLOOKUP('Current Month data '!$A135,'Current Month data '!$A$2:$W$243,23,0)=VLOOKUP('Current Month data '!$A135,'Prior Month data'!$A$2:$W$243,23,0),"",'Current Month data '!A135)

NOW,

I am trying to combine both these IF Functions. I need my formula to check both these conditions and display a value if any of these conditions has been fulfilled. I tried using the below two formulas but could not succeed. Could you please help me on a better way to combine my formulas.

=OR(IF(COUNTIF('Current Month data '!$A$2:$A$243,'Prior Month data'!$A136),"",'Prior Month data'!$A136),IF(VLOOKUP('Current Month data '!$A135,'Current Month data '!$A$2:$W$243,23,0)=VLOOKUP('Current Month data '!$A135,'Prior Month data'!$A$2:$W$243,23,0),"",'Current Month data '!A135))


=(IF(COUNTIF('Current Month data '!$A$2:$A$243,'Prior Month data'!$A136),"",'Prior Month data'!$A136),IF(VLOOKUP('Current Month data '!$A135,'Current Month data '!$A$2:$W$243,23,0)=VLOOKUP('Current Month data '!$A135,'Prior Month data'!$A$2:$W$243,23,0),"",'Current Month data '!A135))
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Looks like your individual formulas are returning either a blank "" or a value from within the data (text I'm assuming, since you said a name?) depending on whether the IF test is true or false, respectively. What this means when you're using the OR statement is that it'll be seeing something like =OR("",textresult), neither of which will be registered as a fulfilment of the condition.

If all you want is a TRUE or FALSE result out of your combined formula, you just need the individual tests, and not the results you've returned in the individual formula. Try something like the formula below (will need to check I've got the tests correct to rightly return a TRUE or FALSE result):

=OR(COUNTIF('Current Month data '!$A$2:$A$243,'Prior Month data'!$A136)>0,VLOOKUP('Current Month data '!$A135,'Current Month data '!$A$2:$W$243,23,0)=VLOOKUP('Current Month data '!$A135,'Prior Month data'!$A$2:$W$243,23,0))
 
Upvote 0

Forum statistics

Threads
1,214,924
Messages
6,122,294
Members
449,077
Latest member
Rkmenon

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