IF and INDEX help

buballo

New Member
Joined
Jan 28, 2013
Messages
48
HI all,
I have about fifty rows that I have to reference in a formalau. I have done the first 4:

=IF($AA$6="NAME 1",ROUNDUP(INDEX($A$5:$Y$56,1,4)*$F$3*(1+$I$62*AB$7)/($D$3*$E$3*$G$3*$H$3),0),IF($AA$6="NAME 2",ROUNDUP(INDEX($A$5:$Y$56,2,4)*$F$3*(1+$I$62*AB$7)/($D$3*$E$3*$G$3*$H$3),0),IF($AA$6="NAME 3",ROUNDUP(INDEX($A$5:$Y$56,3,4)*$F$3*(1+$I$62*AB$7)/($D$3*$E$3*$G$3*$H$3),0),IF($AA$6="NAME 4",ROUNDUP(INDEX($A$5:$Y$56,4,4)*$F$3*(1+$I$62*AB$7)/($D$3*$E$3*$G$3*$H$3),0)))))

SO if AA6 equals NAME 1, I pick up the right number via the "INDEX($A$5:$Y$56,1,4)" part of the formula. My formula works. BUt there are 50 Names I have to reference and each name will chane the row reference in the INDEX part of the formula by 1.

Is there a shorter way of doing this?
Thanks for any help in advance.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Dryver14

Well-known Member
Joined
Mar 22, 2010
Messages
2,396
I am not entirely sure of this as you seem to have a large index A to Y but only slect from column D



=ROUNDUP(INDEX($A$5:$Y$56,match($AA$6,$A$5:$A$56),4))*$F$3*(1+$I$62*AB$7)/($D$3*$E$3*$G$3*$H$3),0)
 
Last edited:

Dryver14

Well-known Member
Joined
Mar 22, 2010
Messages
2,396
This may be better

=(ROUNDUP(VLOOKUP($AA$6,$A$5:$D$56,4,0)*$F$3*(1+$I$62*AB$7)/($D$3*$E$3*$G$3*$H$3),0))
 

buballo

New Member
Joined
Jan 28, 2013
Messages
48
I am not entirely sure of this as you seem to have a large index A to Y but only slect from column D



=ROUNDUP(INDEX($A$5:$Y$56,match($AA$6,$A$5:$A$56),4))*$F$3*(1+$I$62*AB$7)/($D$3*$E$3*$G$3*$H$3),0)

Thanks so much for your time and prompt response. This worked a treat for what I wanted. I did not try the Vlookup version yet, but I think I prefer this one.

Appreciate your help.
 

Watch MrExcel Video

Forum statistics

Threads
1,133,530
Messages
5,659,358
Members
418,498
Latest member
nattynat

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
Top