Help with COUNTIFS formula when counting dates that include a time

UpToTheGills

New Member
Joined
Aug 26, 2022
Messages
38
Office Version
  1. 2019
Platform
  1. MacOS
Morning all,

I am attempting to use COUNTIFS to total the number of trades for a particular month on a different worksheet but the formula I have used just returns a zero. I wondering if that is because I need to take account of the dates to count also include the time?

Excel Formula:
=COUNTIFS('IC Live 4004xxxx'!$B$3:$B$353,">="&C5,'IC Live 4004xxxx'!$B$3:$B$353,"<="&EOMONTH(C5,0))

I can't figure out what is incorrect about the above formula… 🤔

The dates that I want to count appear formatted as below:
Screenshot 2022-09-02 at 10.25.42.png


Thank you for any assistance.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Excel Formula:
=COUNTIFS('IC Live 4004xxxx'!$D$3:$D$353,">="&C5,'IC Live 4004xxxx'!$D$3:$D$353,"<"&EOMONTH(C5,0)+1)

Just tried the above but still shows as zero.
Strange, looks fine to me, must be something real simple that I am overlooking.
 
Upvote 0
From the mini-sheet in post#9 the problem is that C5 is empty, the date is in B5 which is a merged cell (yet another reason why should never use them).
 
Upvote 0
Thanks both. Yes - was referencing the incorrect cell. Formula now works.

I merged the cell so that the data would display where I wanted it for purposes of maximum legibility but it doesn't need to be merged so I will un-merge them all.
 
Upvote 0
No it's not possible, only one post can be marked as the solution.
 
Upvote 0
glad you have it all sorted now
Interesting about the EOMONTH() , i never tested that , but I can see how that would be an issue with time , noted for future - thanks Fluff
 
Upvote 0
Much appreciated, especially the ease with which it was possible to upload a sample of the spreadsheet using XL2BB and the speed with which replies came and a solution eventually found.

Plus all the more better that the solution was the result of a simple mistake arising out of prioritising display/formatting over the actual data but it's good to be reminded of best practice to avoid them in the first place.
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,937
Members
449,094
Latest member
teemeren

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