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

#### slam

##### Well-known Member
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

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
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))))

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!

Replies
6
Views
479
Replies
1
Views
567
Replies
1
Views
394
Replies
5
Views
1K
Replies
7
Views
2K

1,196,414
Messages
6,015,127
Members
441,874
Latest member
saustark

### 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.

### Which adblocker are you using?

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

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