IF and INDEX help

buballo

Board Regular
Joined
Jan 28, 2013
Messages
50
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

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
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:
Upvote 0
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))
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,218,751
Messages
6,144,284
Members
450,535
Latest member
Erlull

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