+ Reply to Thread
Results 1 to 6 of 6

Calculating number of days in a month selected from a drop down menu

  1. #1
    Registered User
    Join Date
    01-19-2015
    Location
    Virginia
    MS-Off Ver
    Office 2013
    Posts
    12

    Calculating number of days in a month selected from a drop down menu

    I have a drop down menu that allows me to select the current month. Is there a way to have excel calculate the number of days in the month based on the month I select? and is it possible to use the number of days in a forumal within the same document? For example: I would select January and on my form. I have a cell titled "Allotted units per payroll" (based on total number of days in the month multiplied by units allotted each day) so I need to take the units allotted for the month divided by the total number of days in the month and then multiple that number by days in each payroll (which will vary between 15 and 16 days based on days in the month) or is there an easier way to get what I want.

    thank you
    Anthony

  2. #2
    Registered User
    Join Date
    01-16-2015
    Location
    Houston, TX
    MS-Off Ver
    2010
    Posts
    16

    Re: Calculating number of days in a month selected from a drop down menu

    Days in Month dropdown.xlsxI would use a vlookup from the result of the drop down to a chart that lists each month and the number of days. See attached.

  3. #3
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 365
    Posts
    2,406

    Re: Calculating number of days in a month selected from a drop down menu

    Assumed your month formatted text "January" on A1:

    =DAY(DATE(YEAR(MONTH(DATEVALUE(A1&" 1")));MONTH(MONTH(DATEVALUE(A1&" 1")))+1;1)-1)

  4. #4
    Registered User
    Join Date
    01-19-2015
    Location
    Virginia
    MS-Off Ver
    Office 2013
    Posts
    12

    Re: Calculating number of days in a month selected from a drop down menu

    thank you, works just fine.

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Calculating number of days in a month selected from a drop down menu

    Try this in B1

    =DAY(EOMONTH(1&A1,0))

    Format B1 as General or Number

    Row\Col
    A
    B
    1
    January
    31
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,721

    Re: Calculating number of days in a month selected from a drop down menu

    ....or even

    =32-DAY((1&A1)+31)


    .......but what result do you want for February? Those formulas will always give you 28 for February.....unless the current year is a leap year, for the whole of 2016 it will give the result 29
    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)

Similar Threads

  1. Limit number of times a value may be selected from a drop down menu
    By searnold56 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-20-2013, 08:54 PM
  2. Calculating number of days in each month during a given period.
    By josnah in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-28-2007, 02:52 AM
  3. [SOLVED] Calculating recurring date in following month, calculating # days in that period
    By Walterius in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 03:05 AM
  4. [SOLVED] Calculating recurring date in following month, calculating # days in that period
    By Walterius in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 12:05 AM
  5. [SOLVED] Calculating the Number of Days in a Month
    By lj@spu.edu in forum Excel General
    Replies: 16
    Last Post: 06-03-2005, 07:05 AM

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