+ Reply to Thread
Results 1 to 15 of 15

count number of months

  1. #1
    Registered User
    Join Date
    06-30-2010
    Location
    Newport New VA
    MS-Off Ver
    Excel 2003
    Posts
    97

    count number of months

    I need to create a formula that will count numbe rof months..Basically if you took this month ..then how many months back is the month in a certain cell..

    What I came up with does that, but the only problem is its using a 30 day count..so that December shows up as both 1 and 2 months back..

    Here is the formula I currently have: =MONTH(TODAY()-F189)

    Notice how even though all of them are December some are counting as 1 month back and other are counted as 2 months back.. I tried using other functions like "now" but this is the closes I got to what I want... Would appreciate any help anyone can give me on this. Thanks.

    date months back from current month
    12/26/2013 2
    12/26/2013 2
    12/27/2013 2
    12/30/2013 1
    12/30/2013 1
    12/30/2013 1
    12/30/2013 1
    12/31/2013 1
    12/31/2013 1
    12/31/2013 1
    12/31/2013 1
    12/31/2013 1
    12/31/2013 1
    12/31/2013 1

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: count number of months

    What happens if you use?

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    06-30-2010
    Location
    Newport New VA
    MS-Off Ver
    Excel 2003
    Posts
    97

    Re: count number of months

    That is the formula that I used. So not quite understanding your question. When I use that formula..I get the results I posted in the post.. For December I get 1, until the date is beyond 30 days then it becomes 2... I need it to just look at the month, not count by days.. so if you were to take this month... then December 2013 would be 1 month back, November 2013 would be 2 months back etc.

  4. #4
    Registered User
    Join Date
    06-30-2010
    Location
    Newport New VA
    MS-Off Ver
    Excel 2003
    Posts
    97

    Re: count number of months

    Sorry I take that back I didn't notice the "-month" in your formula.. However when I use the formula You suggested I get a "1" for every month. So that did not work either...Thank you.

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,504

    Re: count number of months

    Maybe DATEDIF can do this:
    =DATEDIF(F189,TODAY(),"m")
    Quang PT

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: count number of months

    Perhaps

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-30-2010
    Location
    Newport New VA
    MS-Off Ver
    Excel 2003
    Posts
    97

    Re: count number of months

    Quote Originally Posted by bebo021999 View Post
    Maybe DATEDIF can do this:
    =DATEDIF(F189,TODAY(),"m")
    Sorry ..that gives the same result as the original formula..

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,504

    Re: count number of months

    What is the value in F189 should be? can you upload a small worksheet?

  9. #9
    Registered User
    Join Date
    06-30-2010
    Location
    Newport New VA
    MS-Off Ver
    Excel 2003
    Posts
    97

    Re: count number of months

    OK I attached a sample worksheet..
    Attached Files Attached Files

  10. #10
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,504

    Re: count number of months

    I use:
    =DATEDIF(D3,TODAY(),"m")
    and it works.
    Anyway, there are differences from 30/12/2013. Your desired result is 1, but mine is 0.
    Can you explain why is 1, while today is 28, equals 0 month as my result?

  11. #11
    Registered User
    Join Date
    06-30-2010
    Location
    Newport New VA
    MS-Off Ver
    Excel 2003
    Posts
    97

    Re: count number of months

    Ok The formula you just posted is doing the same as my original formula.. basically it is counting 30 days..so it looking at todays date and counting back 30 days as 1 month.. so when you get to Dec 27th it see that as more than 30 days so now that is another month.. etc.. What I need it to do is look at all Dec as 1, all Nov as 2, all Oct as 3 etc.. so when I put in new dates in February it wil then look at all Jan 2014 as 1, Dec 2013 as 2, Nov 2013 as 3, and so on.. I want the formula to make all the changes and conversion. In other words when i copy in new dates into th date fields and the current month has changed, the formula takes in account that the month has changed..that is why I was using "today" function. I don't want to have to go into the formula every month and change something it it.

  12. #12
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,504

    Re: count number of months

    How about:
    =INT((EOMONTH(TODAY(),0)-EOMONTH(D3,0))/30)

  13. #13
    Registered User
    Join Date
    06-30-2010
    Location
    Newport New VA
    MS-Off Ver
    Excel 2003
    Posts
    97

    Re: count number of months

    Bingo...chicken Dinner we have a winner.. Thanks Bebo for your tenacity...

  14. #14
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,504

    Re: count number of months

    Nice to hear that.
    Anyway, this way of month calculation seems so strange to me ...

  15. #15
    Registered User
    Join Date
    06-30-2010
    Location
    Newport New VA
    MS-Off Ver
    Excel 2003
    Posts
    97

    Re: count number of months

    Quote Originally Posted by bebo021999 View Post
    Nice to hear that.
    Anyway, this way of month calculation seems so strange to me ...
    Basically what it comes down to is I am trying to find out what is older than 3 months, and what is 3 months or less from tthe current month.

+ 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 COUNT(IF(... to count number of months in years
    By Abid123 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-17-2014, 11:21 AM
  2. Formula to count the number of different months in a range
    By Fishkeeper in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 10-23-2013, 10:37 AM
  3. [SOLVED] Can i count the number of months in a specific range
    By radicrains in forum Excel General
    Replies: 12
    Last Post: 09-21-2011, 03:06 AM
  4. Count Number Of Elapsed Months
    By simonyglog in forum Excel General
    Replies: 4
    Last Post: 04-08-2011, 10:34 AM
  5. count number of months year to date
    By coal_miner in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-04-2005, 10:06 AM

Tags for this Thread

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