Index and Match Formula

davidhall80

Well-known Member
Joined
Jul 8, 2006
Messages
663
Column A is 'Employee Name'. Column B is Hire Date by week. Beginning in column D and Row 2 and ending 52 columns to the right are weeks of the year paid. In column C, I want to add the three weeks of pay since hire date.

example...


..........A...........B..........C...........D...........E.............F..............G.........

1.....................................................................................................

2. .......Pay By Weeks...................1............2............3................4........

3.......................................................................................................

4.Employee...Hire ....Sum.of.3.............................................................
..................Week..............................................................................
5. John..........1.........................78.52........96.45.......45.35.........62.15

6. Ricky.........3.......................................................56.25..........78.15

7.Scott..........1.........................59.15.......14.06........78.51..........96.15

8.Tanya.........2........................................59.45.........96.15.........104.59





What I want in column C is the sum of three weeks of pay beginning with thier hire data. Because Johns hire week was 1, I would add his week 1 pay (78.52) plus week two pay (96.45) plus week three pay (45.35). Because Tanya's Hire Week was two, I would add 59.45 and 96.15. I've tried to do an Index Match formula but am unsuccessful if different employees have the same hire week. Any help at all would be appreciated. Thanks
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Assuming that for Tanya Week 2, 3, and 4 would be summed, try...

C5, copied down:

=SUM(INDEX(D5:BC5,MATCH(B5,$D$2:$BC$2,0)):INDEX(D5:BC5,MATCH(B5,$D$2:$BC$2,0)+2))

If the hire date is Week 51 or 52 and you'd like to sum the available pay, try the following instead...

=SUM(INDEX(D5:BC5,MATCH(B5,$D$2:$BC$2,0)):INDEX(D5:BC5,MIN(COLUMNS($D$2:$BC$2),MATCH(B5,$D$2:$BC$2,0)+2)))

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,183
Members
449,071
Latest member
cdnMech

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