+ Reply to Thread
Results 1 to 8 of 8

using results of a formula in a count if when the results are a date

  1. #1
    Forum Contributor
    Join Date
    11-18-2014
    Location
    England
    MS-Off Ver
    365
    Posts
    132

    using results of a formula in a count if when the results are a date

    Hi I have a list of dates in one column and then another column which lists the month this date falls into by name. the month name is created using this formula (date being in column L - there are also some blank cells in column L, I have set the format on the month name cells to custom, type mmmmmm so it brings back the full month name).

    =IF(L10=0,"",L10)

    I now want to have a formula that counts every date in January and then another one that counts February etc.... If I do a normal countif formula it comes back as 0 as it won't count any of the cells containing a formula. Can anyone help me with this?

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: using results of a formula in a count if when the results are a date

    You don't really need the second column:

    =COUNTIFS(A:A,">="&C1,A:A,"<"&EDATE(C1,1))

    where C1 contains 01/01/2015, formatted as mmmm, C2, 01/02/2015; C3 01/03/2015, etc....
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Contributor
    Join Date
    11-18-2014
    Location
    England
    MS-Off Ver
    365
    Posts
    132

    Re: using results of a formula in a count if when the results are a date

    Hi the date cells (C1 in your message) are not formatted as MMMMMM they are formatted as date *14/03/2015 will this solution still work?

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: using results of a formula in a count if when the results are a date

    Odd. When they left here they were definitely formatted as mmmm. When I open the posted sheet, it, too, shows formatting as mmmm. In the version I posted, C1 contains the the date 01/01/2015, formatted mmmm and thus showing the word January; C2, February; etc.

    However remember that a formatting is just that - it changes the appearrance of what is in the cell, not its actual value, so the formula works (do a quick manual check using the sheet I posted).
    Last edited by Glenn Kennedy; 12-04-2015 at 08:12 AM. Reason: clarification of ambiguous wording

  5. #5
    Forum Contributor
    Join Date
    11-18-2014
    Location
    England
    MS-Off Ver
    365
    Posts
    132

    Re: using results of a formula in a count if when the results are a date

    Hi sorry, my mistake, ignore my previous post. the formula works fine on your attachement but I cannot get it to work on mine! My data and formulas are on different tabs on my spreadsheet so my formula looks like this:

    =COUNTIFS('Open Days'!L:L,">="&Summary!D8,'Open Days'!L:L,"<"&EDATE(Summary!D8,1))

    open days is the tab with the data and summary is the tab with the criteria and where I want the formula result.TEST.xlsx

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: using results of a formula in a count if when the results are a date

    You made two errors. Firstly, in the summary sheet, the months were NOT entered as dates, formatted to look like month names, but just as month names. Secondly, you didn't lock the count column to $L:$L - as you copied it across it incremented from column L:L to M:M, to N:N, etc.

    see sheet.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    11-18-2014
    Location
    England
    MS-Off Ver
    365
    Posts
    132

    Re: using results of a formula in a count if when the results are a date

    Thank you so much that has worked!! schoolboy error on not locking the range, I should have known better than that!

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: using results of a formula in a count if when the results are a date

    We all do it... and then spend ages wondering why it isn't working. A fresh pair of eyes usuually spots wee goof-ups like that very quickly. Glad to have helped & thanks for adding Reputation.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Using VLookup but results show formula instead of results...
    By excel me in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 11-28-2013, 09:40 PM
  2. [SOLVED] Need to count business days in a date range with results grouped by fiscal year
    By PaulStamper in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-07-2013, 11:46 AM
  3. Replies: 14
    Last Post: 06-27-2012, 04:26 PM
  4. [SOLVED] Count Occurrences and Fill Cells with Results Using a Date Range
    By CWatsonJr in forum Excel General
    Replies: 20
    Last Post: 06-07-2012, 02:33 PM
  5. Replies: 3
    Last Post: 03-31-2010, 11:47 AM
  6. Copy Formula results and paste only results
    By Tom K in forum Excel General
    Replies: 1
    Last Post: 01-10-2008, 12:23 PM
  7. [SOLVED] array formula count results of two tests
    By windsurferLA in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-25-2006, 07:35 PM
  8. Getting a count of formula results only.
    By Casey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-29-2005, 03:36 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1