SUMIFS/Unique formula

Add365

New Member
Joined
Jun 12, 2021
Messages
35
Office Version
  1. 365
Platform
  1. Windows
Hi everyone,

Hope you can help, I created an entry tab with 4 columns of data that gets sorted and entered into another tab called unique, this basically filters down column A and sorts it numerically and shows the totals for column B,C & D relating to the certain number in A1, A2 etc. (Screenshot below,)
1644010211243.png
1644010243690.png


The Formula's I have used in the unique tab on the right are
Cell A2 =SORT(UNIQUE(Entry!A2:A1048576))
Cell B2 =SUMIFS(Entry!B$2:B$1048576,Entry!A$2:A$1048576,Unique!A2)
Cell C2 =SUMIFS(Entry!C$2:C$1048576,Entry!A$2:A$1048576,Unique!A2)
Cell D2 =SUMIFS(Entry!D$2:D$1048576,Entry!A$2:A$1048576,Unique!A2)
and dragged the formula down in cells B,C, & D

This all works fine but now I need to add 2 more columns in as per below

1644010417333.png
1644010447399.png


I need the unique tab to work as it did before but also filtering column B & C aswell as Column A.
I have changed the formula in Cell A2 to =SORT(UNIQUE(Entry!A2:C1048576)) so it sorts columns A,B & C. (not sure if this is the best way to do it)?
But I need to know what to change the formulas in B2,C2,D2 etc as it is looking at Column A and adding the net weight, gross weight & value up everytime it see's the same number in column A. I need it to work it out correctly, I have done a manual example below of how it should look when its worked out correctly.

1644011214918.png


Help please.

Thank you
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
For the future, you might investigate XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with. ;)

Have you considered using Excel's built-in Pivot Table feature (tabular form)?

Add365.xlsm
ABCDEFGHIJKLMN
1CNNCountryPrefNWGWValueCNNCountryPrefSum of NWSum of GWSum of Value
23UKY1001001001UKY100100100
32DEY1001001001USAN100100100
41USAN1001001001USAY200200200
51UKY1001001002DEY200200200
61USAY1001001003UKY100100100
71USAY100100100
82DEY100100100
9
Entry


A couple of other comments:
It is a bad idea to use the sheet name in the reference to a cell or range on the sheet that the formula is in.
Unless you really have massive data, I would recommend against using (virtually) whole column references. Just pick a number big enough to be sure t0 cover any data you might have (maybe 10,000?)
Cell B2 =SUMIFS(Entry!B$2:B$1048576,Entry!A$2:A$1048576,Unique!A2)
 
Upvote 0
Hi Thanks for your help, but I will be pasting random data into the entry tab which I want my unique tab to condense down for me, so this can be uploaded to another program in that format.
All I need to work out is what formula to put in D2,E2,E2 so when it see's a code in colum A it doesnt just add the net weight, gross weight and value all together if column A has the same code in it twice or 3 times. I want it to filter it down more so it goes on the criteria of column A,B & C instead of just column A.

Can you let me know if this is possible as Im guessing it is just changing the formula a bit that I have in cells D2,E2,F2. Cell D2 = SUMIFS(Entry!D$2:D$1048576,Entry!A$2:A$1048576,Unique!A2)

I can use XL2BB if it helps?
 
Upvote 0
Here you go

Export Multi Line Copy.xlsx
ABCDEFGH
1CNNCountry of OriginPreference Yes or NoNett WeightGross WeightVALUERunning Total£ 700.00
21234567890UKY100100100
31234567890DEY100100100
41111111111USAN100100100
51111111111UKY100120100
61232222222USAY100100100
71111111111UKN100100100
81111111111UKN100100100
9
Entry
Cell Formulas
RangeFormula
H1H1=SUM(F2:F10000)
Cells with Data Validation
CellAllowCriteria
A1:A9Text length=10


Export Multi Line Copy.xlsx
ABCDEFGH
1For Col A - "CNN"Country of OriginPreference Yes or NoNett WeightGross WeightFor Col C - "Value"Running Total£ 1,700.00
21111111111USAN400420400
31111111111UKY400420400
41111111111UKN400420400
51232222222USAY100100100
61234567890UKY200200200
71234567890DEY200200200
8000000
9000
Unique
Cell Formulas
RangeFormula
H1H1=SUM(F2:F1048576)
A2:C8A2=SORT(UNIQUE(Entry!A2:C1048576))
D2:D9D2=SUMIFS(Entry!D$2:D$1048576,Entry!A$2:A$1048576,Unique!A2)
E2:E9E2=SUMIFS(Entry!E$2:E$1048576,Entry!A$2:A$1048576,Unique!A2)
F2:F9F2=SUMIFS(Entry!F$2:F$1048576,Entry!A$2:A$1048576,Unique!A2)
Dynamic array formulas.
 
Upvote 0
This would be the expected results, which I have entered manually just to show an example of what I want the formulas in D2,E2 & F2 to do
Export Multi Line Copy.xlsx
ABCDEFGH
1For Col A - "CNN"Country of OriginPreference Yes or NoNett WeightGross WeightFor Col C - "Value"Running Total£ 700.00
21111111111USAN100100100
31111111111UKY100120100
41111111111UKN200200200
51232222222USAY100100100
61234567890UKY100100100
71234567890DEY100100100
8000
Unique
Cell Formulas
RangeFormula
H1H1=SUM(F2:F1048576)
A2:C8A2=SORT(UNIQUE(Entry!A2:C1048576))
Dynamic array formulas.
 
Upvote 0
How about
+Fluff 1.xlsm
ABCDEFGHI
1For Col A - "CNN"Country of OriginPreference Yes or NoNett WeightGross WeightFor Col C - "Value"Running Total700
21111111111USAN100100100
31111111111UKY100120100
41111111111UKN200200200
51232222222USAY100100100
61234567890UKY100100100
71234567890DEY100100100
8
Data
Cell Formulas
RangeFormula
H1H1=SUM(F2#)
A2:C7A2=SORT(UNIQUE(FILTER(Entry!A2:C10000,Entry!A2:A10000<>"")))
D2:F7D2=SUMIFS(Entry!D2:D10000,Entry!$A2:$A10000,INDEX($A2#,,1),Entry!$B2:$B10000,INDEX($A2#,,2),Entry!$C2:$C10000,INDEX($A2#,,3))
Dynamic array formulas.
 
Upvote 0
How about
+Fluff 1.xlsm
ABCDEFGHI
1For Col A - "CNN"Country of OriginPreference Yes or NoNett WeightGross WeightFor Col C - "Value"Running Total700
21111111111USAN100100100
31111111111UKY100120100
41111111111UKN200200200
51232222222USAY100100100
61234567890UKY100100100
71234567890DEY100100100
8
Data
Cell Formulas
RangeFormula
H1H1=SUM(F2#)
A2:C7A2=SORT(UNIQUE(FILTER(Entry!A2:C10000,Entry!A2:A10000<>"")))
D2:F7D2=SUMIFS(Entry!D2:D10000,Entry!$A2:$A10000,INDEX($A2#,,1),Entry!$B2:$B10000,INDEX($A2#,,2),Entry!$C2:$C10000,INDEX($A2#,,3))
Dynamic array formulas.

Yes that is it, brilliant I knew it could be done just couldnt work out the formula.

Thanks so much for your help
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,912
Messages
6,122,204
Members
449,072
Latest member
DW Draft

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