+ Reply to Thread
Results 1 to 5 of 5

A formula to look at cell containing a date and return number of days in that month.

  1. #1
    Registered User
    Join Date
    02-20-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    22

    A formula to look at cell containing a date and return number of days in that month.

    Hi All,

    I have in cell A1 a date [i.e. 06/02/2012] in B1, i would like a forumla that looks at A1 and then returns the number of days in that month.

    so my answer in this case would be 29, as there were 29 days in Feb 2012.

    Any help would be appreciated..

    Many Thanks
    PW.

  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: A formula to look at cell containing a date and return number of days in that mon

    Hi

    Try this.

    =DAY(DATE(YEAR(A1),MONTH(A1)+1,1)-1)

    Hope to helps you.
    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
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: A formula to look at cell containing a date and return number of days in that mon

    Or
    Please Login or Register  to view this content.
    Last edited by Pepe Le Mokko; 03-01-2012 at 05:22 AM. Reason: Correction

  4. #4
    Registered User
    Join Date
    02-20-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: A formula to look at cell containing a date and return number of days in that mon

    Thankyou both, problem sorted thanks.

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: A formula to look at cell containing a date and return number of days in that mon

    In Excel 2007 the shortest way would be

    =DAY(EOMONTH(A1,0))

    or you can use this formula in any version

    =42-DAY(A1-DAY(A1)+42)
    Audere est facere

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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