Count specific text in specific cells?

Geek Girl 007

Board Regular
Joined
Mar 12, 2022
Messages
172
Office Version
  1. 2021
Platform
  1. Windows
ROTAS.xlsx
ABCD
1Day:SunMon
2Date:29-Dec30-Dec
3HOBBAName 1RD
4Dep 1Name 2OFF
5
6
7
8
9Dep 2Name 3
10
11
12Dep 3Name 4 OFF
13
14
15Dep 4Name 5
16
17
18Total Managers off:
19Total Staff off:
Sheet6
Cells with Data Validation
CellAllowCriteria
C3:D3List=LIST_one
C4:D17List=List_two






I want row 18 to add up rows 3, 4, 9, 12 and 15 only if they contain the text 'RD' or 'OFF'
Can this be done??
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Do you mean something like this?
1736190681594.png


Formula in cell C18 (and then copied to cell D18):
Excel Formula:
=SUM(COUNTIFS($B3:$B17,"<>",C3:C17,{"RD","OFF"}))
 
Upvote 0
Do you mean something like this?
View attachment 120995

Formula in cell C18 (and then copied to cell D18):
Excel Formula:
=SUM(COUNTIFS($B3:$B17,"<>",C3:C17,{"RD","OFF"}))
This is fab, I thought it would be easier :( because I wanted to do the same formula in all the other cells for Total staff off.
Eventually there will be names in all the boxes in column B, will this still work then??
 
Upvote 0
This is fab, I thought it would be easier :( because I wanted to do the same formula in all the other cells for Total staff off.
Eventually there will be names in all the boxes in column B, will this still work then??
It checks every row for a value in column B, and one of those codes in the other columns.
If both conditions are met, it returns that row in the count.
 
Upvote 0
It checks every row for a value in column B, and one of those codes in the other columns.
If both conditions are met, it returns that row in the count.
I thought so, then no, this doesn't work for my needs, I'm sorry, I should have been clearer.
Eventually, I will have the names of the manager at the top of each section, I want to be able to add up how many managers are off and how many staff are off as in rows 18 and 19.....?


ROTAS.xlsx
ABCD
1Day:SunMon
2Date:29-Dec30-Dec
3HeadManager 1RD
4Dep 1Manager 2OFF
5Staff 1
6Staff 2OFF
7Staff 3
8Staff 4
9Dep 2Manager 3
10Staff 1OFF
11Staff 2
12Dep 3Manager 4OFF
13Staff 1
14Staff 2
15Dep 4Manager 5
16Staff 1OFF
17Staff 2
18Total Managers off:
19Total Staff off:
Sheet6
Cells with Data Validation
CellAllowCriteria
C3:D3List=LIST_one
C4:D17List=List_two
 
Upvote 0
Try:
Book1
ABCD
1Day:SunMon
2Date:12/29/202512/30/2025
3HeadManager 1RD
4Dep 1Manager 2OFF
5Staff 1
6Staff 2OFF
7Staff 3
8Staff 4
9Dep 2Manager 3
10Staff 1OFF
11Staff 2
12Dep 3Manager 4OFF
13Staff 1
14Staff 2
15Dep 4Manager 5
16Staff 1OFF
17Staff 2
18Total Managers off:3
19Total Staff off:3
Sheet1
Cell Formulas
RangeFormula
D18D18=SUM((A3:A17<>"")*((D3:D17="RD")+(D3:D17="OFF")))
D19D19=SUM((A3:A17="")*((D3:D17="RD")+(D3:D17="OFF")))
 
Upvote 0
Solution
Try:
Book1
ABCD
1Day:SunMon
2Date:12/29/202512/30/2025
3HeadManager 1RD
4Dep 1Manager 2OFF
5Staff 1
6Staff 2OFF
7Staff 3
8Staff 4
9Dep 2Manager 3
10Staff 1OFF
11Staff 2
12Dep 3Manager 4OFF
13Staff 1
14Staff 2
15Dep 4Manager 5
16Staff 1OFF
17Staff 2
18Total Managers off:3
19Total Staff off:3
Sheet1
Cell Formulas
RangeFormula
D18D18=SUM((A3:A17<>"")*((D3:D17="RD")+(D3:D17="OFF")))
D19D19=SUM((A3:A17="")*((D3:D17="RD")+(D3:D17="OFF")))
Thank you, I will have a play and get back to you, this looks great though.....
 
Upvote 0
I thought so, then no, this doesn't work for my needs, I'm sorry, I should have been clearer.
Eventually, I will have the names of the manager at the top of each section, I want to be able to add up how many managers are off and how many staff are off as in rows 18 and 19.....?


ROTAS.xlsx
ABCD
1Day:SunMon
2Date:29-Dec30-Dec
3HeadManager 1RD
4Dep 1Manager 2OFF
5Staff 1
6Staff 2OFF
7Staff 3
8Staff 4
9Dep 2Manager 3
10Staff 1OFF
11Staff 2
12Dep 3Manager 4OFF
13Staff 1
14Staff 2
15Dep 4Manager 5
16Staff 1OFF
17Staff 2
18Total Managers off:
19Total Staff off:
Sheet6
Cells with Data Validation
CellAllowCriteria
C3:D3List=LIST_one
C4:D17List=List_two
Yes, sorry that wasn't quite clear from the original question.
I am glad that Cubist was able to find a solution that works for you.
 
Upvote 0
Also note that my original formula should also work, if you adjust it slightly to check column A and not B, i.e.
Excel Formula:
=SUM(COUNTIFS($A3:$A17,"<>",D3:D17,{"RD","OFF"}))
 
Upvote 0

Forum statistics

Threads
1,226,059
Messages
6,188,637
Members
453,487
Latest member
LZ_Code

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