Forum Discussion

SPC123's avatar
SPC123
Copper Contributor
Apr 03, 2020

Convert Days to whole months

I have a list of days that I would like to convert to months.

 

Started with a formula:  =IF(AND(BO2>=1,BO2<=30),"1 Month",IF(AND(BO2>=31,BO2<=60),"2 Months"  etc. 

 

However, my list of days is quite long.  Is there a quicker way to accomplish?

 

Again, I just want the month number in which a date would 'fit' into, e.g 15 days is 1 month,  33 days is 2 months.

 

Thank you

4 Replies

  • mathetes's avatar
    mathetes
    Silver Contributor

    SPC123 

     

    How precise do you want to be?

    If I understand your request, you're really simply asking "If we assume that 30 days equals 1 month, how can I turn any given number into the number of months that number of days would amount to?"

     

    That would actually be a fairly simple formula: in English, you might write it out as "Take any given number and divide it by 30, making sure we're getting a whole number as the result; but other than if we start with 0, the minimum has to be 1"

     

    In Excel speak that would be =ROUNDUP(A2/30,0)  assuming your entering number is in Cell A2. The ROUNDUP function, with '0" as the last argument, rounds up the quotient to the nearest whole number. If you enter a zero in cell A2, you'll get zero as a result; anything else gives you the number you're looking for, given the general assumption that one month equals 30 days.

Resources