Sum with some criteria

freddocp

New Member
Joined
Sep 28, 2024
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Please, I am having some challenges with a sum with a few criteria, please view the sample attached.

1- I need to sum up the same Part Numbers (column A) I made an example with Descr 2 and Descr 15.

2- Just sum up the different lots (Column B) the lot that has some repeated should not be included in the sum.

3- Status (column C) only consider the terms with ?Demand? in the sum.

In column E: the values I need as a result. For the examples Descr 2 and Descr 15

Note: Remember that you'll need to fill in the whole spreadsheet afterward.

Sum with a few criteria - Rev.0.xlsx
G
12
Sheet1


Thank you in advance.
tela 2024-09-28 135916.png
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Unfortunately, I have the issue of the sum of repeated values ig I go straight with the pivot. The Lots that are the same, I should not sum.
 
Upvote 0
Hello, test the following if it works for you:

Excel Formula:
=LET(
part,$A$2:$A$25,
status,$C$2:$C$25,
headers,$A$1:$D$1,
f,$A$2:$D$25,
a,UNIQUE(FILTER(f,(part=A2)*(status="Demand"))),
b,CHOOSECOLS(a,XMATCH("Qantity",headers)),
IF(COUNTIFS(part,A2,status,"Demand")<=1,D2,SUM(b)))
 
Upvote 0
Hello hagia_sofia
Thank you very much!

I believe the formula is just like that, I've put into practice what I need, but it's still giving a difference, I'd be very grateful if you could help:

ED_ORDER_NUM (column A) , must be different to be summed, however, I think I had not mentioned before, ED_ITEM (column B), must be equal to be summed. And the status in this case must be “On hand”
Include the required result in column F

Help - Sum with a few criteria - Rev.2;;.xlsx
C
12
Sheet1
 

Attachments

  • sep, 30 - 2024 print excel.png
    sep, 30 - 2024 print excel.png
    33.3 KB · Views: 5
Upvote 0
I am not sure if I understand it correctly - based on the example, how is it possible that the first row is 3?
 
Upvote 0
I am not sure if I understand it correctly - based on the example, how is it possible that the first row is 3?
I understand, I don't think I've been very clear, sorry about that. I'm attaching another print, see if that's better.
 

Attachments

  • Excel doubt 30-09-2024.JPG
    Excel doubt 30-09-2024.JPG
    67.3 KB · Views: 5
Upvote 0
Ah, many thanks for the clarification. Would this work then:

Excel Formula:
=LET(
f,UNIQUE(FILTER($A$2:$D$8,($B$2:$B$8=B2)*($C$2:$C$8="On hand"))),
IF(C2="Supply",0,SUM(CHOOSECOLS(f,XMATCH("QTY",$A$1:$D$1)))))
 
Upvote 0
Ah, many thanks for the clarification. Would this work then:

Excel Formula:
=LET(
f,UNIQUE(FILTER($A$2:$D$8,($B$2:$B$8=B2)*($C$2:$C$8="On hand"))),
IF(C2="Supply",0,SUM(CHOOSECOLS(f,XMATCH("QTY",$A$1:$D$1)))))
Hi! It works great , thank you! But I am struggling when I take to a model with more columns and try to adapt your formula. do you see where I am getting it wrong?
 

Attachments

  • sep, 30 - 2024 print excel - Rev.1.png
    sep, 30 - 2024 print excel - Rev.1.png
    60.3 KB · Views: 4
Upvote 0
I see. Hopefully you could go with something like this (please adjust ranges):

Excel Formula:
=LET(
a,HSTACK($C$2:$C$5,$F$2:$F$5,$N$2:$N$5,$U$2:$U$5),
f,UNIQUE(FILTER(a,($F$2:$F$5=F2)*($N$2:$N$5="On hand"))),
IF(N2="Supply",0,SUM(CHOOSECOLS(f,4))))
 
Upvote 1
Solution

Forum statistics

Threads
1,222,626
Messages
6,167,157
Members
452,099
Latest member
Auroraaa

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