Sum column using NOT equal to criteria

danhendo888

Board Regular
Joined
Jul 15, 2019
Messages
142
Office Version
  1. 365
Platform
  1. Windows
https://1drv.ms/x/s!AvjBsEPEq12ngUm0YmMHEk1HGIPY?e=npLKjO

My data has account numbers and their corresponding $ value
Trying to add the $ value for those accounts which are not in the list in Column E
I.e. add column B except the items highlighted in grey

How best would you go about it?

(My formula in E15 doesn't seem to work)
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
is that what you want?

with Power Query aka Get&Transform

GL account Total CriteriaSTotal
60701000​
3,626.30​
60701000​
-1230425.17​
60801000​
1,332.17​
60801000​
60901000​
110,013.93​
60901000​
61752000​
(107,053.63)​
63109100​
61753000​
(6,693.94)​
63309000​
61755000​
(202.11)​
61756500​
(1,635.20)​
61781200​
(115.96)​
61782000​
(50,817.26)​
61783000​
(23,062.81)​
61821100​
(299,471.81)​
63101000​
-​
63101300​
-​
63103100​
(4,801.24)​
63104000​
(6,501.22)​
63104100​
(59.07)​
63108000​
(66,549.00)​
63109100​
(3,005.93)​
63301000​
(202,558.79)​
63309000​
(102,428.08)​
67501217​
(191.25)​
67606900​
(207,612.68)​
67909110​
-​
67909900​
(7,113.92)​
68101910​
(2.57)​
69097001​
(245,982.71)​

Code:
[SIZE=1]// Result
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    TypeTbl1 = Table.TransformColumnTypes(Source,{{"GL account", Int64.Type}, {"Total", type number}}),
    Criteria = Excel.CurrentWorkbook(){[Name="Criteria"]}[Content],
    TypeCrt = Table.TransformColumnTypes(Criteria,{{"Criteria", Int64.Type}}),
    Result = Table.NestedJoin(Criteria,{"Criteria"},TypeTbl1,{"GL account"},"Table1",JoinKind.RightAnti),
    Expand = Table.ExpandTableColumn(Result, "Table1", {"GL account", "Total"}, {"GL account", "Total"}),
    #"Grouped Rows" = Table.Group(Expand, {"Criteria"}, {{"STotal", each List.Sum([Total]), type number}}),
    RC = Table.RemoveColumns(#"Grouped Rows",{"Criteria"})
in
    RC[/SIZE]

this is NOT a vba
 
Upvote 0
[.... deleted by me .... I like Jonmo1's formula better ]
 
Last edited:
Upvote 0
.. or in a similar fashion add the ones you want directly

=SUMPRODUCT(--ISNA(MATCH(A5:A30,E7:E11,0)),B5:B30)
 
Upvote 0

Forum statistics

Threads
1,213,552
Messages
6,114,278
Members
448,559
Latest member
MrPJ_Harper

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