Assistance with Index Match formula

Jay88

New Member
Joined
Apr 17, 2023
Messages
7
Office Version
  1. 2019
Platform
  1. Windows
I have the following formular which looks up a fortnightly roster and matches each name and role, summing the total shift length that is in ROSTER!$C$4:$C$800 rows under each name for each shift.

It works fine, though I am wondering if it is possible to reduce repetitions/the formular length by using a nested array of some sorts? I am using Microsoft Excel 2019 LTSC.

All matches each need to reference $C$4:$C$800 offsetting down 2 rows (shift length).

All matches each need to reference AC$4:$AC$800 = $KI2 (position name)

Each day of the roster, all look up $D2 (employee name)
Excel Formula:
G$4:G$800, H$4:H$800, I$4:I$800, J$4:J$800, K$4:K$80,L$4:L$800, M$4:M$800, U$4:U$800, V$4:V$800, W$4:W$800, X$4:X$800, Y$4:Y$800, Z$4:Z$800,AA$4:AA$800


Excel Formula:
=SUM(
    IFNA(INDEX(ROSTER!$C$4:$C$800,MATCH(1,(ROSTER!G$4:G$800=$D2)*(ROSTER!$AC$4:$AC$800=$KI2),0)+2),0),
    IFNA(INDEX(ROSTER!$C$4:$C$800,MATCH(1,(ROSTER!H$4:H$800=$D2)*(ROSTER!$AC$4:$AC$800=$KI2),0)+2),0),
    IFNA(INDEX(ROSTER!$C$4:$C$800,MATCH(1,(ROSTER!I$4:I$800=$D2)*(ROSTER!$AC$4:$AC$800=$KI2),0)+2),0),
    IFNA(INDEX(ROSTER!$C$4:$C$800,MATCH(1,(ROSTER!J$4:J$800=$D2)*(ROSTER!$AC$4:$AC$800=$KI2),0)+2),0),
    IFNA(INDEX(ROSTER!$C$4:$C$800,MATCH(1,(ROSTER!K$4:K$800=$D2)*(ROSTER!$AC$4:$AC$800=$KI2),0)+2),0),
    IFNA(INDEX(ROSTER!$C$4:$C$800,MATCH(1,(ROSTER!L$4:L$800=$D2)*(ROSTER!$AC$4:$AC$800=$KI2),0)+2),0),
    IFNA(INDEX(ROSTER!$C$4:$C$800,MATCH(1,(ROSTER!M$4:M$800=$D2)*(ROSTER!$AC$4:$AC$800=$KI2),0)+2),0),
    IFNA(INDEX(ROSTER!$C$4:$C$800,MATCH(1,(ROSTER!U$4:U$800=$D2)*(ROSTER!$AC$4:$AC$800=$KI2),0)+2),0),
    IFNA(INDEX(ROSTER!$C$4:$C$800,MATCH(1,(ROSTER!V$4:V$800=$D2)*(ROSTER!$AC$4:$AC$800=$KI2),0)+2),0),
    IFNA(INDEX(ROSTER!$C$4:$C$800,MATCH(1,(ROSTER!W$4:W$800=$D2)*(ROSTER!$AC$4:$AC$800=$KI2),0)+2),0),
    IFNA(INDEX(ROSTER!$C$4:$C$800,MATCH(1,(ROSTER!X$4:X$800=$D2)*(ROSTER!$AC$4:$AC$800=$KI2),0)+2),0),
    IFNA(INDEX(ROSTER!$C$4:$C$800,MATCH(1,(ROSTER!Y$4:Y$800=$D2)*(ROSTER!$AC$4:$AC$800=$KI2),0)+2),0),
    IFNA(INDEX(ROSTER!$C$4:$C$800,MATCH(1,(ROSTER!Z$4:Z$800=$D2)*(ROSTER!$AC$4:$AC$800=$KI2),0)+2),0),
    IFNA(INDEX(ROSTER!$C$4:$C$800,MATCH(1,(ROSTER!AA$4:AA$800=$D2)*(ROSTER!$AC$4:$AC$800=$KI2),0)+2),0)
)


Here is what the roster looks like
 

Attachments

  • Capture1.PNG
    Capture1.PNG
    50.3 KB · Views: 11
Last edited:

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Try the following array formula

Excel Formula:
=SUM(IF((Roster!G$4:AA$800=$D2)*(Roster!$AC$4:$AC$800=$KI2),Roster!$C$6:$C$802))
Press CTRL+SHIFT+ENTER to enter array formulas.

😇
 
Upvote 1
Solution
Try the following array formula

Excel Formula:
=SUM(IF((Roster!G$4:AA$800=$D2)*(Roster!$AC$4:$AC$800=$KI2),Roster!$C$6:$C$802))
Press CTRL+SHIFT+ENTER to enter array formulas.

😇
Dante that worked perfectly, thank you!
 
Upvote 1

Forum statistics

Threads
1,224,811
Messages
6,181,082
Members
453,021
Latest member
Justyna P

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