# IF and INDEX help

#### buballo

##### Board Regular
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:
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))

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.

Replies
3
Views
254
Replies
8
Views
261
Replies
1
Views
408
Replies
2
Views
180
Replies
4
Views
225

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.

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