Dynamically sum a row after each row entry has been multiplied by a two way lookup.

PrettyGood_Not Great

Board Regular
Joined
Nov 24, 2023
Messages
95
Office Version
  1. 365
Platform
  1. Windows
My challenge is to take the sum of each row in the data table (large table on right), after each row entry has been multiplied by a two-way lookup to the rate table (small table on left). I have tried working with SUMPRODUCT without success. I have the two way lookup working with a double XLOOKUP but cannot get it to span the range of the entire row to work within the SUMPRODUCT. I need the sum of the entire row in one cell (SUM Result), and the ability to pull it down. Note that none of these ranges have the same dimensions. The data table with the Sum Result is approx. 1000 rows deep. A 365 solution would be ideal, however 2016 techniques are still welcomed.

1703778123898.png
 
As this is a totally different question it needs a new thread. Thanks
ok will do thank you. A question regarding this solution. In trying to make it spill down and I discovered something about the LAMBDA I don`t fully understand. What does the "b" parameter represent in this equation? I can see clearly that the "a" parameter is the date header row.
 
Upvote 0

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
The b is value of the 2nd row as the function loops through the range.
 
Upvote 1
Try
Excel Formula:
=BYROW(I2:X6,LAMBDA(br,SUM(MAP($I$1:$X$1,br,LAMBDA(a,b,IF(ISNUMBER(b),b*XLOOKUP(RIGHT(INDEX(br,,1),2),$A$2:$A$6,XLOOKUP(YEAR(a),$B$1:$F$1,$B$2:$F$6)),0))))))
 
Upvote 1
Solution
=BYROW(I2:X6,LAMBDA(br,SUM(MAP($I$1:$X$1,br,LAMBDA(a,b,IF(ISNUMBER(b),b*XLOOKUP(RIGHT(INDEX(br,,1),2),$A$2:$A$6,XLOOKUP(YEAR(a),$B$1:$F$1,$B$2:$F$6)),0))))))
Stone Cold Fluff. Works perfect. Can you explain the "br" please? I see some indications online that this is a line break? totally lost on how this one is working.
 
Upvote 0
It's just a variable & can be renamed if you want.
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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