Help with adding a couple of IF AND's to this?

slam

Well-known Member
Joined
Sep 16, 2002
Messages
871
Office Version
  1. 365
  2. 2019
I have the following formula I am looking to add a couple more IF conditions to.


=IF(COUNTBLANK(INDIRECT("'R"&ROWS($1:1)&"'!$F$3:$F$34"))=32,"",(INDIRECT("'R"&ROWS($1:1)&"'!$H$39")))


As of right now, it basically says if there are 32 blanks in F3:F34 on the R1 worksheet, display a blank, else display the value in H39 on the R1 worksheet.


If Setup!B5 is "Yes" AND Setup!B6 is "No", I need it to do exactly as it currently does. If Setup!B5 is "Yes" AND Setup!B6 is "Yes", I need it to do an index/match like this:


INDEX(INDIRECT("'R"&ROWS($1:1)&"'!D3:D34"),MATCH(B3,INDIRECT("'R"&ROWS($1:1)&"'!F3:F34"),0)))


I''m struggling to get the nested IF's working, so any help would be greatly appreciated.

If you're wondering what happens if any other conditions are met such as Setup!B5 being "No", I have some VBA which then hides the column where this formula resides, so it doesn't really need to include any conditions for it :)


Thank you
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Hello,

like this?

=IF(AND(SetUp!B5="Yes",SetUp!B6="No"),IF(COUNTBLANK(INDIRECT("'R"&ROWS($1:1)&"'!$F$3:$F$34"))=32,"",(INDIRECT("'R"&ROWS($1:1)&"'!$H$39"))),IF(AND(SetUp!B5="Yes",SetUp!B6="Yes"),INDEX(INDIRECT("'R"&ROWS($1:1)&"'!D3:D34"),MATCH(B3,INDIRECT("'R"&ROWS($1:1)&"'!F3:F34"),0))))
 
Upvote 0
Hello,

like this?

=IF(AND(SetUp!B5="Yes",SetUp!B6="No"),IF(COUNTBLANK(INDIRECT("'R"&ROWS($1:1)&"'!$F$3:$F$34"))=32,"",(INDIRECT("'R"&ROWS($1:1)&"'!$H$39"))),IF(AND(SetUp!B5="Yes",SetUp!B6="Yes"),INDEX(INDIRECT("'R"&ROWS($1:1)&"'!D3:D34"),MATCH(B3,INDIRECT("'R"&ROWS($1:1)&"'!F3:F34"),0))))

Perfect, thank you!
 
Upvote 0

Forum statistics

Threads
1,214,875
Messages
6,122,044
Members
449,063
Latest member
ak94

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