Help with COUNTIFS formula

bootj1234

Board Regular
Joined
Aug 27, 2012
Messages
85
Is it possible to use the IF/OR function at the beginning of a COUNTIFS formula in order for the COUNTIF portion of the formula to run once one of two text criteria are met within the cells of a specified column range? If so, how would the IF/OR portion of the formula have to be written prior to the COUNTIFS portions of the formula in order for the overall formula to work?

The two text criteria to be used in the specified column range would be "EVM" or "GRM".

Any help with solving this is greatly appreciated!
 
I am hoping that you can see the below screen shot showing my data. Data in the range $A$4:$F$25 contain the data ranges I am using in combination with criteria in cells M5 through R5 to create the following COUNTIFS formula to populate cells I5 and L5 with the results of the COUNTSIF formula.

=COUNTIFS($B$4:$B$25,$M5,$C$4:$C$25,$N5,$D$4:$D$25,$O5,$E$4:$E$25,$P5,$F$4:$F$25,$Q5,$F$4:$F$25,$R5)

As I mentioned in my previous communications, I am trying to modify the beginning of the above formula so that it references cells in range $A4:$A25 to determine which Retail Mall (EVM or GRM) is associated with the rest of the above COUNTIFS formula so that it governs the correct resulting Daily Total Plays in cell I5 for EVM and L5 for GRM.

Thanks - John
 
Last edited by a moderator:
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Excel 2012
ABCDEFGHIJKLMNOPQR
1
2Retail(EVM) EASTVIEW(GRM) GREECE RIDGE
3MallYearMonthDayDatePlay TimePlaysPlays
4EVM2018NovWednesday2110:00:24 AMGRD TOTALS =22GRD TOTALS ==22YearMonthDayDateFirst Play TimeLast Play Time
5EVM2018NovWednesday2110:05:24 AMDaily Totals =0Daily Totals ==222018NovWednesday21>=10:00:00 AM<=11:00:00 AM
6EVM2018NovWednesday2110:10:55 AM
7EVM2018NovWednesday2110:15:55 AM
8EVM2018NovWednesday2110:21:26 AMCorrect ResultResult Should be 10
9EVM2018NovWednesday2110:26:26 AM
10EVM2018NovWednesday2110:31:58 AM
11EVM2018NovWednesday2110:36:58 AM
12EVM2018NovWednesday2110:42:29 AM
13EVM2018NovWednesday2110:47:29 AM
14EVM2018NovWednesday2110:53:00 AM
15EVM2018NovWednesday2110:58:01 AM
16GRM2018NovWednesday2110:05:24 AM
17GRM2018NovWednesday2110:10:55 AM
18GRM2018NovWednesday2110:15:55 AM
19GRM2018NovWednesday2110:21:26 AM
20GRM2018NovWednesday2110:26:26 AM
21GRM2018NovWednesday2110:31:58 AM
22GRM2018NovWednesday2110:36:58 AM
23GRM2018NovWednesday2110:42:29 AM
24GRM2018NovWednesday2110:47:29 AM
25GRM2018NovWednesday2110:53:00 AM
Sheet2
Cell Formulas
RangeFormula
I4=SUM(I5:I5)
I5=A1:R26
L4=SUM(L5:L5)
L5=COUNTIFS($B$4:$B$25,$M5,$C$4:$C$25,$N5,$D$4:$D$25,$O5,$E$4:$E$25,$P5,$F$4:$F$25,$Q5,$F$4:$F$25,$R5)
 
Upvote 0
Just add another criteria range with the criteria of "EVM"? It would be helpful for you to add the expected results if you dont mean that.
 
Upvote 0
I hope you can see this image okay?

Based on the following COUNTIFS formula, Range A4:F25 contain the ranges that I am using in my COUNTIFS formula and cells M5 through R5 are the criteria that I am using in my COUNTIFS formula.

=COUNTIFS($B$4:$B$25,$M5,$C$4:$C$25,$N5,$D$4:$D$25,$O5,$E$4:$E$25,$P5,$F$4:$F$25,$Q5,$F$4:$F$25,$R5)

What I need your help with is how to write a conditional part for this formula that would be placed prior to the COUNTIFS portion that would look at column range A4:A25 and use the text EVM in this range to deliver the correct result answer of 12 into cell I5, and applying the same formula to cell L5, a correct result answer of 10 for the text GRM.
I really appreciate your assistance with modifying my formula to get it to work the way I am hoping it can.

2jgthu.png
 
Upvote 0
If you want the same formula ie you can copy it from cell I4 and paste it into cell L4 then based on your spreadsheet you could use:

=COUNTIFS($A$4:$A$25,MID(H2,2,3),$B$4:$B$25,$M5,$C$4:$C$25,$N5,$D$4:$D$25,$O5,$E$4:$E$25,$P5,$F$4:$F$25,$Q5,$F$4:$F$25,$R5)
 
Upvote 0
This is working great! I never would have know to add the MID Function into the formula as a solution.

It was also a good learning lesson for me on how to add an HTML file and PNG file into a post thread.

Working with you through the MrExcel Forum Message Board on this project was a great learning experience in regards to both MID function in Excel and for how to add image files to my thread posts to better communicate through visuals what I am trying to accomplish.

Thanks to you so very much. This has been a fantastically productive day!

Kindest regards - John
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,632
Latest member
jladair

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