Sum(countifs...

surkdidat

Well-known Member
Joined
Oct 1, 2011
Messages
597
Office Version
  1. 365
Can someone help please - I have the following formula which works as it should for Column Z, but need it to work with if a value in Z, AA or AB please...
Code:
=IF(TODAY()<J162,"",

SUM(COUNTIFS($P$149:$P$157,"<"&$J161+7,$R$149:$R$157,">"&$J161+7,$Q$149:$Q$157,"YES",$E$149:$E$157,"<>OP SUPPORT"),COUNTIFS($P$149:$P$157,"<"&$J161+7,$R$149:$R$157,"",$Q$149:$Q$157,"YES",$E$149:$E$157,"<>OP SUPPORT"),

COUNTIFS($P$149:$P$157,"<"&$J161+7,$R$149:$R$157,">"&$J161+7,$Q$149:$Q$157,"",$E$149:$E$157,"<>OP SUPPORT"),COUNTIFS($P$149:$P$157,"<"&$J161+7,$R$149:$R$157,"",$Q$149:$Q$157,"",$E$149:$E$157,"<>OP SUPPORT"),

COUNTIFS($P$149:$P$157,"<"&$J161+7,$Z$149:$Z$157,">"&$J161+7,$Q$149:$Q$157,"NO",$E$149:$E$157,"<>OP SUPPORT"),COUNTIFS($P$149:$P$157,"<"&$J161+7,$Z$149:$Z$157,"",$Q$149:$Q$157,"NO",$E$149:$E$157,"<>OP SUPPORT")))
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Is this a typo (the double quotes in red), it's syntactically incorrect?

=IF(TODAY()"&$J161+7,$Q$149:$Q$157...

Sometimes the forum corrupts posts if you have < or > characters
You can get round this by inserting a space before and after them.
 
Last edited:
Upvote 0
My browser is doing strange things.... I will try again..

WDIT: What I am copying and pasting is changing! I have no idea what is happening!<j162,"",
<j162,"",
<j162,"",
<j162,"",


<j162,"",
<j162,"",
<j162,"",
<j162,"",
<j162,"",

Is this a typo (the double quotes in red), it's syntactically incorrect?

=IF(TODAY()"&$J161+7,$Q$149:$Q$157...

Sometimes the forum corrupts posts if you have < or > characters
You can get round this by inserting a space before and after them.
</j162,"",
</j162,"",
</j162,"",
</j162,"",
</j162,"",
</j162,"",
</j162,"",
</j162,"",
</j162,"",
 
Last edited:
Upvote 0
<j162,"",
Sorry for the editing, what I am typing, is not putting up the same when I hit reply.... but the code doesn't include the " as below.... I am really not sure how i can get around this at the moment....
Code:
<j162,"",
<j162,"",
<j162,"",
<j162,"",


=IF(TODAY()<J162,"",SUM(COUNTIFS($P$149:$P$157,"<"&$J161+7,$R$149:$R$157,">"&$J161+7,$Q$149:$Q$157,"YES",$E$149:$E$157,"<>OP SUPPORT"),COUNTIFS($P$149:$P$157,"<"&$J161+7,$R$149:$R$157,"",$Q$149:$Q$157,"YES",$E$149:$E$157,"<>OP SUPPORT"),COUNTIFS($P$149:$P$157,"<"&$J161+7,$R$149:$R$157,">"&$J161+7,$Q$149:$Q$157,"",$E$149:$E$157,"<>OP SUPPORT"),COUNTIFS($P$149:$P$157,"<"&$J161+7,$R$149:$R$157,"",$Q$149:$Q$157,"",$E$149:$E$157,"<>OP SUPPORT"),COUNTIFS($P$149:$P$157,"<"&$J161+7,$Z$149:$Z$157,">"&$J161+7,$Q$149:$Q$157,"NO",$E$149:$E$157,"<>OP SUPPORT"),COUNTIFS($P$149:$P$157,"<"&$J161+7,$Z$149:$Z$157,"",$Q$149:$Q$157,"NO",$E$149:$E$157,"<>OP SUPPORT")))-IF(TODAY()<J162,"",SUM(COUNTIFS($AA$149:$AA$157,"<"&$J161+6,$AA$149:$AA$157,">="&$J161)))

<j162,"",<j162,"",
<j162,"",




Is this a typo (the double quotes in red), it's syntactically incorrect?

=IF(TODAY()"&$J161+7,$Q$149:$Q$157...

Sometimes the forum corrupts posts if you have < or > characters
You can get round this by inserting a space before and after them.
</j162,"",
</j162,"",<j162,"",
</j162,"",
</j162,"",
</j162,"",
</j162,"",
</j162,"",
 
Last edited:
Upvote 0
Rich (BB code):
 =if(today()  <  j162,"",

 
sum(countifs($p$149:$p$157,"<"&$j161+7,$r$149:$r$157,">"&$j161+7,$q$149:$q$157,"yes",$e$149:$e$157,"<>opsupport"),countifs($p$149:$p$157,"<"&$j161+7,$r$149:$r$157,"",$q$149:$q$157,"yes",$e$149:$e$157,"<>opsupport"),
 
countifs($p$149:$p$157,"<"&$j161+7,$r$149:$r$157,">"&$j161+7,$q$149:$q$157,"",$e$149:$e$157,"<>opsupport"),countifs($p$149:$p$157,"<"&$j161+7,$r$149:$r$157,"",$q$149:$q$157,"",$e$149:$e$157,"<>opsupport"),
 
countifs($p$149:$p$157,"<"&$j161+7,$z$149:$z$157,">"&$j161+7,$q$149:$q$157,"no",$e$149:$e$157,"<>opsupport"),countifs($p$149:$p$157,"<"&$j161+7,$z$149:$z$157,"",$q$149:$q$157,"no",$e$149:$e$157,"<>opsupport")

))
 
Last edited:
Upvote 0
sum(countifs($p$149:$p$157,"<"&$j161+7,$r$149:$r$157,">"&$j161+7...

What happens if it's EQUAL to J161+7 ? The result will be zero, it won't get picked up.


For the solution to your problem just copy some more COUNTIFS that relate to Z into the formula changing Z to AA and AB.
 
Upvote 0
If I add another line (or two it is counting the occurrences if it does not meet the criteria of Z or AAA twice.....

sum(countifs($p$149:$p$157,"<"&$j161+7,$r$149:$r$157,">"&$j161+7...

What happens if it's EQUAL to J161+7 ? The result will be zero, it won't get picked up.


For the solution to your problem just copy some more COUNTIFS that relate to Z into the formula changing Z to AA and AB.
 
Upvote 0

Forum statistics

Threads
1,224,930
Messages
6,181,826
Members
453,067
Latest member
mdiz777

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