Using Unique,Filter & ChooseCols and to see if I can use SUMIF with it?

Peter Davison

Active Member
Joined
Jun 4, 2020
Messages
439
Office Version
  1. 365
Platform
  1. Windows
I have this unique Filter and Choosecols formula below
=UNIQUE(FILTER(CHOOSECOLS('Data Import Store Product'!$D$3:$AD$100000,1,2,3,4,5,6,7,8,9,10,11),'Data Import Store Product'!$D$3:$D$100000<>""))
Is it possible to add to this formula to sum columns like 8,9,10,11 (which are values) but based on the unique criteria from Column 1 (D)
 
My Column D is by product so there may be 100 rows with the same Sub Cat Number (e.g. 14), then it goes onto the next product etc.
I was looking for the answer to sum up all products that have 14 and so on so it ends up on my answer section with only unique sub cats like the example above.
Is that possible?
 
Upvote 0

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
This is an example of the sheet it is looking at -
1706091974926.png
 
Upvote 0
Your UNIQUE function is looking at columns D:N, so all those rows will be returned individually, and that will lead to repetition of your criteria.
 
Upvote 0
Try something like:

Excel Formula:
=LET(
rng,FILTER('Data Import Store Product'!$D$3:$N$100000,'Data Import Store Product'!$D$3:$D$100000<>""),
critRng, CHOOSECOLS(rng,1),
uCrit,UNIQUE(critRng),
sumRng, CHOOSECOLS(rng,8,9,10,11),
BYROW(ucrit,lambda(r,SUM(IF(critRng=r,sumRng)))))
 
Upvote 0
Okay I understand.
I am bringing in the Unique part from Columns D to J then to achieve the sum for each sub cat I am using sumifs with criteria.
I was only wondering if I could achieve it in one formula.
Thanks for helping me with the understanding.
Appreciate your time.
 
Upvote 0
That is adding up all four columns 8,9,10,11 together instead of individually.
Can the unique part of Columns G to L come in before the sum up columns?
 
Upvote 0
I don't follow any of that.
If you are only using col D as criteria, what do cols G:L have to do with anything?
What output are you expecting? Need to see sample data and sample output at this point, please.
 
Upvote 0
This is what the output looks like
Column D is the criteria for the Sum
Columns E to I are associated information and are not part of any analysis
Columns J to M are the columns to be summed individually based on the criteria Column D

Hope that makes sense?
Thank you again for all this help.
1706093800708.png
 
Upvote 0

Forum statistics

Threads
1,215,133
Messages
6,123,233
Members
449,092
Latest member
SCleaveland

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