sum+if

Vanda_a

Well-known Member
Joined
Oct 29, 2012
Messages
938
Dear all

Could you help me with this issue please?
I would like to sum only the transaction that does not contain "APPLE"
Ex :
[TABLE="class: grid, width: 489"]
<colgroup><col><col span="3"><col></colgroup><tbody>[TR]
[TD]Num[/TD]
[TD]Name[/TD]
[TD]Debit[/TD]
[TD]Credit[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]APPLE[/TD]
[TD]1000[/TD]
[TD][/TD]
[TD]sum only Num 2 and 3[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]ABC[/TD]
[TD][/TD]
[TD]100[/TD]
[TD]due to 1 contain "APPLE"[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]001[/TD]
[TD][/TD]
[TD]900[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]ABC[/TD]
[TD]1000[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]410[/TD]
[TD][/TD]
[TD]100[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]555[/TD]
[TD][/TD]
[TD]900[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Orange[/TD]
[TD]1000[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Mango[/TD]
[TD][/TD]
[TD]100[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]001[/TD]
[TD][/TD]
[TD]800[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]555[/TD]
[TD][/TD]
[TD]100[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Thank you very much
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Hi,

Are you talking about the "Debit" or "Credit" Column?
 
Upvote 0
In E2 control+shift+enter, not just enter and copy across to F2:

=SUM(IF(ISNA(MATCH($A$2:$A$11,IF($B$2:$B$11="apple",$A$2:$A$11),0)),C$2:C$11))
 
Upvote 0
In E2 control+shift+enter, not just enter and copy across to F2:

=SUM(IF(ISNA(MATCH($A$2:$A$11,IF($B$2:$B$11="apple",$A$2:$A$11),0)),C$2:C$11))
Good morning. It works. Thank you very much. May i know what is ISNA is used in this formula?
 
Upvote 0
In E2 control+shift+enter, not just enter and copy across to F2:

=SUM(IF(ISNA(MATCH($A$2:$A$11,IF($B$2:$B$11="apple",$A$2:$A$11),0)),C$2:C$11))

Could you help explain why i can not invoke your formula into mine?
Code:
=SUM(IF(('All JL'!$B:$B="SINV")*(LEFT('All JL'!$E:$E,4)="PNN-")*(LEFT('All JL'!$F:$F,2)="41")+('All JL'!$G:$G="Customers' Deposits")*(ISNA(MATCH('All JL'!$E:$E,IF('All JL'!$G:$G="VAT-Output",'All JL'!$E:$E),0))),'All JL'!$I:$J))

I am trying to sum all transactions that contain no VAT-Output but the transactions has to meet some criteria as well. B:B="SINV", E:E first 4 letter ="PNN-", F:F first 2 letter = "41" or G:G = Customers' Deposits

Thank you
 
Last edited:
Upvote 0
1. You haven't told the outcome which obtains.

2. Avoid whole column referencing for efficiency reasons.

3. Why + ?

4. Does the following succeed? Control+shift+enter…

=SUM(IF(ISNA(MATCH('All JL'!$E$2:$E$100,IF('All JL'!$G$2:$G$100="VAT-Output",'All JL'!$E$2:$E$100),0)),IF((LEFT('All JL'!$E$2:$E$100,4)="PNN-")*('All JL'!$B$2:$B$100="SINV")*(LEFT('All JL'!$F$2:$F$100,2)="41")*('All JL'!$G$2:$G$100="Customers' Deposits"),'All JL'!$I$2:$J$100)))
 
Upvote 0
1. You haven't told the outcome which obtains.

2. Avoid whole column referencing for efficiency reasons.

3. Why + ?

4. Does the following succeed? Control+shift+enter…

=SUM(IF(ISNA(MATCH('All JL'!$E$2:$E$100,IF('All JL'!$G$2:$G$100="VAT-Output",'All JL'!$E$2:$E$100),0)),IF((LEFT('All JL'!$E$2:$E$100,4)="PNN-")*('All JL'!$B$2:$B$100="SINV")*(LEFT('All JL'!$F$2:$F$100,2)="41")*('All JL'!$G$2:$G$100="Customers' Deposits"),'All JL'!$I$2:$J$100)))

Good afternoon. it works now. Thank you very much. + sign because i would like to have or because if F:F is false then look up G:G.
By the way, may i know what is ISNA does in the formula?
 
Upvote 0
Good afternoon. it works now. Thank you very much. + sign because i would like to have or because if F:F is false then look up G:G.

Is this + still needed?

By the way, may i know what is ISNA does in the formula?

IF(ISNA(MATCH('All JL'!$E$2:$E$100,IF('All JL'!$G$2:$G$100="VAT-Output",'All JL'!$E$2:$E$100),0))

reads:

Filter for, i.e. select, the E cells which do not correspond to any G cell that equals VAT-Output. Thus:

If an E cell from the E range is not in the sublist of E cells for which G = VAT-Output (constructed by the inner IF in the quoted expression), execute the rest of the larger formula.
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,263
Members
452,627
Latest member
KitkatToby

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