+ Reply to Thread
Results 1 to 10 of 10

Most recent year in COUNTIFS

  1. #1
    Registered User
    Join Date
    05-08-2018
    Location
    Croatia
    MS-Off Ver
    Microsoft Office 2007 Enterprise
    Posts
    12

    Most recent year in COUNTIFS

    I have formula to count how many times does the text repeats in 2017. year:

    =COUNTIFS(A3:A53; ">=1.1.2017"; A3:A53; "<=31.12.2017"; B3:B53; "text1")

    What I want is formula to count how many times does the text repeats in most recent year (now it is 2018.)
    Regards
    Regards,
    DarkLord76865

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: Most recent year in COUNTIFS

    Try this:

    =COUNTIFS(A3:A53, ">="&DATE(YEAR(TODAY()),1,1), A3:A53, "<="&DATE(YEAR(TODAY()),12,31), B3:B53, "text1")

    Or:

    =SUMPRODUCT((YEAR(A3:A53)=YEAR(TODAY()))*(B3:B53= "text1"))
    Last edited by Phuocam; 05-14-2018 at 05:59 AM.

  3. #3
    Registered User
    Join Date
    05-08-2018
    Location
    Croatia
    MS-Off Ver
    Microsoft Office 2007 Enterprise
    Posts
    12

    Re: Most recent year in COUNTIFS

    Quote Originally Posted by Phuocam View Post
    Try this:

    =COUNTIFS(A3:A53, ">="&DATE(YEAR(TODAY()),1,1), A3:A53, "<="&DATE(YEAR(TODAY()),12,31), B3:B53, "text1")

    Or:

    =SUMPRODUCT((YEAR(A3:A53)=YEAR(TODAY()))*(B3:B53= "text1"))
    Just tried first formula you suggested and it works, but now I have different question.
    I need formula that will do everything the same as formula you wrote, except it should count how many times does "text1" appears in year that was before most recent year.

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: Most recent year in COUNTIFS

    =SUMPRODUCT((YEAR(A3:A53)=YEAR(TODAY()-1))*(B3:B53= "text1"))

  5. #5
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Most recent year in COUNTIFS

    Can I suggest an intermediate solution.. of putting current year in a cell lets say for the sake of the example in "B1"

    Please Login or Register  to view this content.
    it is my experience that in may no one thinks about coming in the the office on january 2nd, 2019 to build the report for the whole year. Only to find out that becasue the today formula is in formula that to the logic of the formula excel considers 2018 to be last year and but we humans need more time to finish up last years reporting so we want to still see 2018 as the current year in roughly the fist 2 weeks of january.
    The formula given before was fine.. but if you need to look back at last year early in the new year you might want to avoid using today() in the formula. and the separate cell gives you the option.

  6. #6
    Registered User
    Join Date
    05-08-2018
    Location
    Croatia
    MS-Off Ver
    Microsoft Office 2007 Enterprise
    Posts
    12

    Re: Most recent year in COUNTIFS

    Quote Originally Posted by Phuocam View Post
    =SUMPRODUCT((YEAR(A3:A53)=YEAR(TODAY()-1))*(B3:B53= "text1"))
    Thanks for trying to help but this doesn't work for me.
    I tried this formula and it just counts how many times "text1" appears in most recent year (2018.).
    If you know any other ways to do that I would appreciate your help.

  7. #7
    Registered User
    Join Date
    05-08-2018
    Location
    Croatia
    MS-Off Ver
    Microsoft Office 2007 Enterprise
    Posts
    12

    Re: Most recent year in COUNTIFS

    Quote Originally Posted by Roel Jongman View Post
    Can I suggest an intermediate solution.. of putting current year in a cell lets say for the sake of the example in "B1"

    Please Login or Register  to view this content.
    it is my experience that in may no one thinks about coming in the the office on january 2nd, 2019 to build the report for the whole year. Only to find out that becasue the today formula is in formula that to the logic of the formula excel considers 2018 to be last year and but we humans need more time to finish up last years reporting so we want to still see 2018 as the current year in roughly the fist 2 weeks of january.
    The formula given before was fine.. but if you need to look back at last year early in the new year you might want to avoid using today() in the formula. and the separate cell gives you the option.
    Thanks on trying to help but unfortunately this is not what I am looking for. I don't want to use more than one cell.

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,552

    Re: Most recent year in COUNTIFS

    Note: Please use the Quick Reply for responding as opposed to 'Reply With Quote' unless there is some confusion as to whom or what point you are speaking.
    I believe that if Phuocam's formula is modified as follows it will work:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  9. #9
    Registered User
    Join Date
    05-08-2018
    Location
    Croatia
    MS-Off Ver
    Microsoft Office 2007 Enterprise
    Posts
    12

    Re: Most recent year in COUNTIFS

    Thanks on help!!
    This is working.
    Regards

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,552

    Re: Most recent year in COUNTIFS

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ 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. Replies: 3
    Last Post: 10-04-2022, 07:27 AM
  2. Determine most recent combi of year and quarter and put related value to cell
    By Robert1311 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-26-2018, 03:31 AM
  3. [SOLVED] countifs to find the total count between this year and last year for series of data
    By maher2014 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-06-2016, 02:39 AM
  4. [SOLVED] VLOOKUP to summarize most recent year and pass/fail result.
    By DocPickles in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-27-2016, 05:22 AM
  5. [SOLVED] formula to determine most recent month/year in range
    By Robert1311 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-29-2015, 09:08 AM
  6. [SOLVED] Formula that returns the most recent date for a particular year
    By Brian Douglas in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-10-2013, 02:02 AM
  7. Each Item's Most Recent/Month/Half Year Average Price
    By jo3c in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2011, 12:01 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