Can array have to conditions to meet before summing the numbers?

Oberon70

Board Regular
Joined
Jan 21, 2022
Messages
160
Office Version
  1. 365
Platform
  1. Windows
I have a table with 8,000 transactions, The reference number can appear on several transactions. I am wanting to sum the amount and commission based on the claim number and the invoice number.

Example:

The below has the same claim number but there are different invoices numbers

1649837788798.png


The end result would be

1649838037447.png


I have arrays that I have been provided which works great with summing the reference number and then the amounts, but not the above.

thanks,
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
will a SUMIFS() with a UNIQUE()
work

something like
Book1
ABCDEF
1refidinamcomnet
2aa111001090
3aa1120020180
4aa1230030270
5aa1340040360
6aa1150050450
7aa1260060540
8
9
10
11
12
13aa1180080720
14aa1290090810
15aa1340040360
Sheet3
Cell Formulas
RangeFormula
A13:C15A13=UNIQUE(A2:C7)
D13:F15D13=SUMIFS(D$2:D$7,$A$2:$A$7,$A13,$B$2:$B$7,$B13,$C$2:$C$7,$C13)
Dynamic array formulas.


Note: Images are difficult to see , and also requires that I input all the data myself, which is very time consuming.

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC , then put the sample spreadsheet onto a share
I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
 
Upvote 0
Solution
Okay, below is a sample table.

Reference IDAgent NameAmountInc CommissionNet Invoice Num
0201373161157248Waynetec253.4421.566995
0201373161157248Waynetec253.4421.566995
0201373161157248Waynetec253.4421.567101
0201373161157248Waynetec253.4421.567209
0201373161157248Waynetec253.4421.567433
0201373161157248Waynetec253.4421.567433
0201467561261615Waynetec202.7517.256879
0201467561261615Waynetec202.7517.256879
0201467561261615Waynetec202.7517.256879
0201467561261615Waynetec202.7517.256879
0201467561261615Waynetec202.7517.256995
0201467561261615Waynetec202.7517.256995
0201467561261615Waynetec202.7517.256995
0201467561261615Waynetec202.7517.256995
0201467561261615Waynetec202.7517.256995
0201467561261615Waynetec202.7517.257101
0201467561261615Waynetec202.7517.257101
0201467561261615Waynetec202.7517.257101
0201467561261615Waynetec202.7517.257209
0201467561261615Waynetec202.7517.257209
0201467561261615Waynetec202.7517.257209
0201467561261615Waynetec202.7517.257209
0201467561261615Waynetec202.7517.257209
0201467561261615Waynetec202.7517.257321
0201467561261615Waynetec202.7517.257321
0201467561261615Waynetec202.7517.257321
0201467561261615Waynetec202.7517.257321
0201467561261615Waynetec202.7517.257433
0201467561261615Waynetec202.7517.257433
0201467561261615Waynetec202.7517.257433
0201467561261615Waynetec202.7517.257433
0201786401573876Waynetec202.7517.256879
0201786401573876Waynetec202.7517.256879
0201786401573876Waynetec202.7517.256995
0201786401573876Waynetec202.7517.256995
0201786401573876Waynetec202.7517.257101
0201786401573876Waynetec202.7517.257101
0201786401573876Waynetec202.7517.257209
0201786401573876Waynetec202.7517.257209
0201786401573876Waynetec202.7517.257321
0201786401573876Waynetec202.7517.257321
0201786401573876Waynetec202.7517.257433
0201786401573876Waynetec202.7517.257433
0201786401573876Waynetec202.7517.257433
0201810461598050Waynetec405.534.56879
0201810461598050Waynetec405.534.56995
0201810461598050Waynetec405.534.57101
0201810461598050Waynetec405.534.57209
0201810461598050Waynetec405.534.57321
0201810461598050Waynetec405.534.57433
0201883181642732Waynetec506.8843.126879
0201883181642732Waynetec506.8843.126995
0201883181642732Waynetec506.8843.126995
0201883181642732Waynetec506.8843.127101
0201883181642732Waynetec506.8843.127101
0201883181642732Waynetec506.8843.127101
0201883181642732Waynetec506.8843.127209
0201887571643941Waynetec10013.7586.256995
0201887571643941Waynetec10013.7586.257101
0201887571643941Waynetec10013.7586.257209
0201887571643941Waynetec10013.7586.257321
 
Upvote 0
thanks, but thats a picture again
as mentioned in previous post

i did post a simple example with reference, Id & invoice to show how it might be done
and summarised
also a pivot table may work

Also as mentioned it would be a lot easier if you posted using XL2BB or a share, sorry to repeat again, just makes it easier

Did you try the functions i posted on your real data ?

Note: Images are difficult to see , and also requires that I input all the data myself, which is very time consuming.

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC , then put the sample spreadsheet onto a share
I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
 
Upvote 0
thanks, but thats a picture again
Actually it's not. It's a Table view from XL2BB ;)
If you scroll down you will see the copy icon in the bottom left.
 
Upvote 0
ahh, okay and sorry i will try the function out.
 
Upvote 0
Which column is the invoice number in?
Your image shows it in col 3, but the mini-sheet has it in col 7
 
Upvote 0
The invoice number can be in any column. When testing out your function I have moved the invoice column to column B. It took me a while to understand the unique function, but it worked great. I have also removed the id number as it won't be needed.

Sorry, below is only an image as I am logged back on my work laptop. Just finish up a few things before going on holiday tomorrow.

1649852448026.png
 
Upvote 0
change that I will be putting the ID's numbers back in.
 
Upvote 0

Forum statistics

Threads
1,217,029
Messages
6,134,099
Members
449,860
Latest member
SimoD

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