lookup & sum for 12 months

JonesyUK

Board Regular
Joined
Oct 11, 2005
Messages
190
Office Version
  1. 365
Platform
  1. Windows
Hi, please help:

I have a spreadsheet that has months along the top(P1, P2, P3, etc, and names along the side(name1, name2, name3 etc,)

I need a formula that will sum 12 months, starting at Px, based on the correct name:

Example1: Period = P2, Name = name3
Formula: vlookup name 3, and then sum from P2 to P13 (12 months) in that row

Example2: Period = P3, Name = name1 (in row2)
Formula: vlookup name1, and then sum P3 to P14 (12 months) in that row

Hope this makes sense,

Thanks a million....

C
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
I've put P1, P2 ... P21 in A1 to V1.
I've put Name 1 to Name 16 in A2 to A17.
The cells B2 to V17 hold the values you want to add.
I've got A22 to hold the period (just a number) and B1 to hold the Name.

The following formula should give the result you want.

=SUM(INDIRECT("R" & MATCH(B22,$A$2:$A$17,0)+1 & "C" & MATCH("P" & A22,$B$1:$V$1,0)+1 & ":R" & MATCH(B22,$A$2:$A$17,0)+1 & "C" & MATCH("P" & A22,$B$1:$V$1,0)+12, FALSE))

Hope this helps.
 
Upvote 0
If you don't want to use a lot of these formulas on your sheet, you could use this sort of idea.

Excel Workbook
ABCDEFGHIJKLMNOPQRS
1PeriodP2
2NameName 3
3Sum56
4
5P1P2P3P4P5P6P7P8P9P10P11P12P13P14P15P16P17P18
6Name 1151555151551555555
7Name 2262644262642646420
8Name 353537753537537371115
9Name 411118811118118181522
10Name 542426642426426261014
Sum 1




If you have a lot of them, or just want to avoid using the volatile OFFSET function, then you could use something like this.

Excel Workbook
ABCDEFGHIJKLMNOPQRS
1PeriodP22
2NameName 33
3Sum56
4
5P1P2P3P4P5P6P7P8P9P10P11P12P13P14P15P16P17P18
6Name 1151555151551555555
7Name 2262644262642646420
8Name 353537753537537371115
9Name 411118811118118181522
10Name 542426642426426261014
Sum 2
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,254
Members
452,900
Latest member
LisaGo

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