Simple formula ?

fireslguk

Active Member
Joined
Nov 11, 2005
Messages
304
I have a table with column a:a dates
Column b with status codes e.g W

I want to produce a report on the total number of say “W” in a set period

So for example

1/1/18 until 30/1/18. Equals 4
1/2/18 until 28/2/18. Equals 1

And so on.

The formula on a different sheet looking at tab “2018-2019”
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
You need a COUNTIFS. It is a fairly simple formula. Something like:

=COUNTIFS(B:B,"W",A:A,">="&date1,A:A,"<="&date2)

Replace date1 and date2 with cell references that contain your dates in question.
 
Upvote 0
Paste your formula.

Funny things happening lol

I discovered blank cells no dates of that makes a difference in the A:A column so put some in - can cells be blank ?


After dragging the auto fill this copied the formula however returned all zeros, then when I clicked on the formula bar and pressed enter the formula worked and returned a number so not sure why the auto fill did that
 
Upvote 0
make sure each cell is pointing to the right range. you have to make a new table

W E R T Y
date1 date2
date date
date date

C2 =COUNTIFS(Sheet1!B:B,B$1,Sheet1!A:A,">=A$2,Sheet1!A:A,"<=B$2)

drag down and across. check for changes
 
Upvote 0
All sorted now, was someone else’s sheet and I didn’t realise they had on calculation manual !!
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

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