Sum specific cells in column based on multiple row criteria

generalmonk

New Member
Joined
Dec 6, 2020
Messages
8
Office Version
  1. 365
Platform
  1. Windows
I cannot find an answer to this anywhere, so hoping you can help! I have a list of ref IDs in Column A which may or may not be unique (eg. 1, 1, 1, 2, 3, 3, 4, 4 ,4 ,4...etc). I need to be able to find the last instance of EACH of these ref IDs in Column A and sum the associated cell values in a column further along in the Spreadsheet. Many thanks in advance.
 

generalmonk

New Member
Joined
Dec 6, 2020
Messages
8
Office Version
  1. 365
Platform
  1. Windows

Sorry Sandy666, thanks kindly for the table, but I am just looking for a formula... would it help if I said the last row of each ID instance was associated with the smallest number in the other column? ie. sum the smallest numbers for each ID (which translate to the last instance of each ID).

Also, Maabadi's lookup formula works but only for one ID instance (eg. ID 1), so I need to add the Lookups (Lookup with ID 1 + Lookup with ID 2, etc. until an arbitary number like 100 or so, which hopefully assumes the IDs do not go beyond 100!) However, is there a way to tell Excel to add nth lookups like this incrementing by 1 every time (representing the next ID) based on the max ID value? Hope that makes sense.

Thanks again and sorry for being a pain...
 

Some videos you may like

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

generalmonk

New Member
Joined
Dec 6, 2020
Messages
8
Office Version
  1. 365
Platform
  1. Windows
Thanks all, I have now resolved it with the following equation:

Excel Formula:
=SUM(XLOOKUP(UNIQUE(A5:A...),A5:A...,P5:P...,"",0,-1))
 
Last edited by a moderator:
Solution

Watch MrExcel Video

Forum statistics

Threads
1,127,359
Messages
5,624,238
Members
416,018
Latest member
mirceaon

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
Top