Sum product with an index

KRTop

New Member
Joined
Jun 16, 2021
Messages
3
Office Version
  1. 365
Platform
  1. Windows
I am trying to do a comparison of current year to prior YTD financial information.


ABCDEFG
Jan-20Feb-20Mar-20Apr-20May-20
4100.50​
Miscellaneous20,84016,69120,08720,72250,600
4100.51​
Parking Garages-----
4100.51​
Professional Buildings-----
4100.65​
Residential1,3501,2152,2901,6401,840

I want to be able to say I want the sum of all of the 4100.50 code in column A for the first 5 periods. So far I have this, but I would like to add an index in there so that I can just change the number of periods and not have to change the columns each month.

SUMPRODUCT((A:A=4100.50)*(C:G))

The 4100.50 would actually be coded to another tab in my workbook. I am trying to add an index for the C:G, but I keep getting an error.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Where do you want the "Index"(No of period) in a different cell or can it be coded in the formula.
 
Upvote 0
I was thinking the index would be in the C:G, so C:index(C:K,5). Next month that would move to 6, but it would be coded to another tab.
 
Upvote 0
Use offset INSTEAD

Book1
ABCDEFGHI
1Jan-20Feb-20Mar-20Apr-20May-20
24100.5Miscellaneous20,84016,69120,08720,72250,600128940
34100.51Parking Garages
44100.51Professional Buildings
54100.65Residential1,3501,2152,2901,6401,840
6
Sheet1
Cell Formulas
RangeFormula
I2I2=SUMPRODUCT((A2:A5=4100.5)*OFFSET(C2:C5,,,,5))
 
Upvote 0
That worked! Thank you! I have never used an offset before.
 
Upvote 0
Glad it worked. Yes, offset is widely used formula in Advanced Excel.
 
Upvote 0

Forum statistics

Threads
1,214,988
Messages
6,122,620
Members
449,092
Latest member
amyap

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