Nested IF's...Re:NBA

gtd526

Well-known Member
Joined
Jul 30, 2013
Messages
657
Office Version
  1. 2019
Platform
  1. Windows
Hello,
Im using the following nested IF's, but get #VALUE! as a result.
If I use a single IF by itself, I get the correct value.
Im looking for whether the row is odd or even, then do the vlookup according to the Row and the $B4 values which results to different columns.

IF(AND(MOD(ROW(),2)=0,$B5>=1),VLOOKUP($A5,$IL$6:$IO$35,4,0),VLOOKUP($A5,$GS$6:$GV$35,4,0)),IF(AND(MOD(ROW(),2)=0,$B5<=-1,$B5>=-4.5),VLOOKUP($A5,$IA$6:$ID$35,4,0),VLOOKUP($A5,$GH$6:$GK$35,4,0)),IF(AND(MOD(ROW(),2)=0,$B5<=-5,$B5>=-9.5),VLOOKUP($A5,$HP$6:$HS$35,4,0),VLOOKUP($A5,$FW$6:$FZ$35,4,0)),IF(AND(MOD(ROW(),2)=0,$B5<=-10),VLOOKUP($A5,$HE$6:$HH$35,4,0),VLOOKUP($A5,$FL$6:$FO$35,4,0))

Thank you
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hello,
Im using the following nested IF's, but get #VALUE! as a result.
If I use a single IF by itself, I get the correct value.
Im looking for whether the row is odd or even, then do the vlookup according to the Row and the $B4 values which results to different columns.

IF(AND(MOD(ROW(),2)=0,$B5>=1),VLOOKUP($A5,$IL$6:$IO$35,4,0),VLOOKUP($A5,$GS$6:$GV$35,4,0)),IF(AND(MOD(ROW(),2)=0,$B5<=-1,$B5>=-4.5),VLOOKUP($A5,$IA$6:$ID$35,4,0),VLOOKUP($A5,$GH$6:$GK$35,4,0)),IF(AND(MOD(ROW(),2)=0,$B5<=-5,$B5>=-9.5),VLOOKUP($A5,$HP$6:$HS$35,4,0),VLOOKUP($A5,$FW$6:$FZ$35,4,0)),IF(AND(MOD(ROW(),2)=0,$B5<=-10),VLOOKUP($A5,$HE$6:$HH$35,4,0),VLOOKUP($A5,$FL$6:$FO$35,4,0))

Thank you
I added the MOD(ROW()2)=1 to remove the IF False statement. And it works.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,918
Messages
6,122,246
Members
449,075
Latest member
staticfluids

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