Count Non Blanks & Blanks

CJones6

New Member
Joined
Oct 4, 2016
Messages
6
Hi There,

I'm looking for help to write a few formulas please.

In my data set, column P,Q,R&S contains over 500 rows of data, some of the cells are populated with a date others are blank.

Column P captures the date that a work activity moved into stage 1.
Column Q captures the date work started.
Column R captures the date work ended
Column S captures the date work exited stage 1.

I need 4 formulas in total. once I understand the logic I can then adapt these, as have over 8 stages to calculate.

I have looked at a combination of counta, countblank and countifs but I can't work the logic for even the first formula. I haven't used excel for the last 4 years so this is definitely a challenge for me.

Formula 1
If column p has a date I need a count of column q without date. This will tell me count of work which has gone into stage 1 but yet to start.

Formula 2
if column p has a date I need a count of column q with a date but column r does not have a date. So work has gone in and started but not finished.

Formula 3
if column p has a date I need a count of column q with a date but column r does have a date and column s doesn't. So work has gone in and started, finished and not exited.

Formula 4
if column R has a date I need a count if column s has a date. So work has finished and exited.


Many thanks for reading, hope it makes sense!
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
I have just used countifs()
on 2 formulas - do they work on all your data - as i think all the formulas needed can probably be done with a countifs()

Formula 1
If column p has a date I need a count of column q without date. This will tell me count of work which has gone into stage 1 but yet to start.
I assume if Column P does NOT have a date then its blank
So you are counting the cells where column P is NOT blank and Column Q is blank
Book3
PQR
31/1/216
41/2/211
51/3/212
61/4/21
71/5/213
81/6/214
91/7/216
101/8/21
111/9/217
121/10/218
131/11/21
141/12/219
151/13/21
161/14/2110
17
18
191/17/21
Sheet2
Cell Formulas
RangeFormula
R3R3=COUNTIFS(P3:P19,"<>",Q3:Q19,"")


Formula 2
if column p has a date I need a count of column q with a date but column r does not have a date. So work has gone in and started but not finished.
Same sort of formula extended for R

Book3
PQRS
31/1/214
41/2/211
51/3/2121
61/4/21
71/5/213
81/6/2141
91/7/2162
101/8/21
111/9/217
121/10/2183
131/11/21
141/12/2191
151/13/21
161/14/2110
17
18
191/17/21
Sheet2
Cell Formulas
RangeFormula
S3S3=COUNTIFS(P3:P19,"<>",Q3:Q19,"<>",R3:R19,"")
 
Upvote 0
Formula 3
if column p has a date I need a count of column q with a date but column r does have a date and column s doesn't. So work has gone in and started, finished and not exited.
=COUNTIFS(P3:P19,"<>",Q3:Q19,"<>",R3:R19,"<>", S3:S19, "")

Formula 4
if column R has a date I need a count if column s has a date. So work has finished and exited.

=COUNTIFS(R3:R19,"<>", S3:S19, "<>")
 
Upvote 0
Solution
Hi,
Thank you for the reply! I have honestly spent hours trying to do this on my own!!

I have worked these formulas into a smaller workbook so I can test out the logic and I'm good up to formula 4.
I have written the formulas to select the columns e.g =COUNTIFS(P:P,"<>",Q:Q,"") and that works great until formula 4.
I have written formula 4 as =COUNTIFS(R:R,"<>", S:S, "<>") and I'm provided with a count of 3 but when written as =COUNTIFS(R2:R22,"<>", S2:S22, "<>") I'm provided with the correct count of 2.
Not sure why formula 4 would calculate a different count. I converted the data to a table to see if this changed the count but it stayed the same. Sorry to come back and ask another question.
Many Thanks!
 
Upvote 0
no problem coming back
Whats in row1 - headings, which may explain and would not be blank and so would be included in the count
 
Upvote 0
This formula counts headers
=COUNTIFS(R:R,"<>", S:S, "<>")

That's why you are getting 3

This Don't
=COUNTIFS(R2:R22,"<>", S2:S22, "<>")
 
Upvote 0
Ok, thank you :)
I get it now, so the non blank count is working great because the header is populated. So I l need to exclude row 1 from the formula range in my masterfile!
Thank you again for help!!
 
Upvote 0

Forum statistics

Threads
1,215,046
Messages
6,122,855
Members
449,096
Latest member
Erald

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