SUMIF criteria met or not met.

Wobzy

Board Regular
Joined
Mar 25, 2017
Messages
54
Hi Guys,

A
B
C
D
E
F
1
MERGED_A1
MERGED_A1
MERGED_A1
MERGED_D1
MERGED_D1
MERGED_D1
2
$50
ITEM
PAID
$45
ITEM
CANCEL
3
MERGED_A3
MERGED_A3
MERGED_A3
MERGED_D3
MERGED_D3
MERGED_D3
4
$50
ITEM
PENDING
$50
ITEM
PAID

<tbody>
</tbody>

My working sheet is much larger but this is the jist of it.

My formula needs to SUM A2,D2,A4,D4 only IF C2,F2,C4,F4 are not equal to "CANCEL" or "PENDING".
I also need to SUM the same former range in the instance that the latter range is equal to CANCEL.

Help is appreciated.

Thank you.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Maybe...

Question 1
=SUMPRODUCT(N(+A2:D4)*(C2:F4="PAID"))

Question 2
=SUMPRODUCT(N(+A2:D4)*(C2:F4="CANCEL"))

Hope this helps

M.
 
Upvote 0
Maybe...

Question 1
=SUMPRODUCT(N(+A2:D4)*(C2:F4="PAID"))

Question 2
=SUMPRODUCT(N(+A2:D4)*(C2:F4="CANCEL"))

Hope this helps

M.

Brilliant, thanks buddy.

But for my purpose example 1 is <>"CANCEL")) where example 2 is ="CANCEL"))

Much appreciated.
 
Upvote 0
Maybe...

Question 1
=SUMPRODUCT(N(+A2:D4)*(C2:F4="PAID"))

Question 2
=SUMPRODUCT(N(+A2:D4)*(C2:F4="CANCEL"))

Hope this helps

M.

I just realized regarding the first example, using <>"PAID")) isnt right for my particular data set.

I've tried using ="DATA1","DATA2")) without success.
I've tried using ,{"DATA1","DATA2"})) without success.
I've also tried using =NAMED_RANGE)) as the data set is part of a data list in a named range, also didn't work.

In this formula how would i go about specifying two criteria using wild cards, or the named range of 50+ cells?

Thank you.


EDIT; all sorted never mind thank you i made it work with the named range.
Actually no i didnt, help still required plz.

=(
 
Last edited:
Upvote 0
Try to provide a data sample for which the formula is not working along with expected result(s).

M.
 
Upvote 0
Try to provide a data sample for which the formula is not working along with expected result(s).

M.


Hi marcelo,

It works great, but i failed to realize SUMPRODUCT isnt going to work with wildcards.

After much googling I gather i need to implement (ISNUMBER(SEARCH but im struggling.

In the example above given that it works, could you show me how to complete the formula using either;
- multiple search criteria (wildcarded) or
- range or named range

Thanks so much again.
 
Upvote 0
The problem is you are using garbage data with bad formatting. Remove merged cells, merged cells are a huge headache when analyzing data. Second, put all similar information in the same column. Maybe work on a macro to format this correctly.
 
Upvote 0
Not sure if i understand what you are looking for

See if this helps


A
B
C
D
E
F
G
H
I
1
MERGED_A1​
MERGED_A1​
MERGED_A1​
MERGED_D1​
MERGED_D1​
MERGED_D1​
Formula​
Exclude​
2
50​
ITEM​
PAID​
45​
ITEM​
CANCEL​
100​
CANCEL​
3
MERGED_A3​
MERGED_A3​
MERGED_A3​
MERGED_D3​
MERGED_D3​
MERGED_D3​
PENDING​
4
50​
ITEM​
PENDING​
50​
ITEM​
PAID​

Name range Exclude = I2:I3 (gray area) contains the keywords that should not be taken in account in calculations.

Formula in H2
=SUMPRODUCT(N(+A2:D4)*ISNA(MATCH(C2:F4,Exclude,0)))

M.
 
Upvote 0

Forum statistics

Threads
1,215,025
Messages
6,122,731
Members
449,093
Latest member
Mnur

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