+ Reply to Thread
Results 1 to 2 of 2

Days To Months and Decimal to Integer

  1. #1
    Forum Contributor
    Join Date
    12-22-2004
    Location
    Kokomo, Indiana
    Posts
    236

    Question Days To Months and Decimal to Integer

    How would I convert the following intervals into integers? The cell A1 contains a decimal number which represents days. I'm interested in getting months and placing an integer into A2. I would like to have all the following intervals in a single cell. Any idea how I can do this without resorting to VBA? I have Windows XP and Excel 2010.

    From 0.0 to 30.0 = 1 Month
    From 30.0 to 60.0 = 2 Months
    From 60.0 to 90.0 = 3 Months
    From 90.0 to 181.0 = 6 Months
    From 180.0 to 271.0 = 9 Months
    From 270.0 to 365.0 = 12 Months
    From 365.0 to 455.0 = 15 Months
    From 455.0 to 547.0 = 18 Months
    From 547.0 to 637.0 = 21 Months
    From 637.0 to 730.0 = 24 Months
    From 730.0 to 820.0 = 27 Months
    From 820.0 to 910.0 = 30 Months
    From 910.0 to 1000.0 = 33 Months
    From 1000.0 to 1095.0 = 36 Months
    From 1095.0 to 1185.0 = 39 Months
    From 1185.0 to 1275.0 = 42 Months
    From 1275.0 to 1365.0 = 45 Months
    From 1365.0 to 1460.0 = 48 Months


    Tony
    Last edited by ajocius; 03-17-2013 at 04:07 PM.

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

    Re: Days To Months and Decimal to Integer

    Try this formula in A2

    =LOOKUP(A1,{0,30,60,90,180,270,365,455,547,637,730,820,910,1000,1095,1185,1275,1365;1,2,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48})

    If you want to shorten the formula place the values in a table - lower bound of days in the first column, months in 2nd and use

    =LOOKUP(A1,Table)
    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