Comments on: Using MONTH and EOMONTH functions in Excel - formula examples

The tutorial explains the nuts and bolts of Excel MONTH and EOMONTH functions. You will find an array of formula examples demonstrating how to extract month from date in Excel, get the first and last day of the month, convert month name to number and more. Continue reading

Comments page 6. Total comments: 491

  1. 30/06/2021, 1:37 pm
    i want this to be converted in month year
    ex;- Jul/21
    =TEXT(value,"mmmm/yyyy")
    applying this formula I am not getting

  2. 1.Column A is names,
    2.Column B is due date,
    3.Column C is END OF TERM and
    4.Column D is Restructured until month(text)

    EX:
    A. Excel
    B. 06/01/2021
    C. 09/01/2021
    D. JULY
    I want to conditionally format these by NAMES highlighted when their DUE DATE is a month away from COLUMN C or D.
    =IF(B2=(C2-30), AND/OR
    =IF(B2=(D2-1),

    I dunno how to proceed please help thanks

    1. Hello!
      If I understand your task correctly, the following formula should work for you:

      =DATEDIF(B1,C1,"m")>=1

      Use this formula in conditional cell formatting as described in this article.
      I hope my advice will help you solve your task.

      1. Noted on all and thank you!! :)

  3. Hi there,

    I've very quickly browsed through your table of contents so I apologise if I've missed what I'm looking for.

    I'm looking to return a numerical value from on the last day of each month.

    Each day has a numerical value
    The date range is a daily range which spans more than 1 year.
    I wish to summarise the returned data by year and month.

    How do I build a formula to achieve this?

    1. Hello!
      To return a list of values for the last day of each month, use the FILTER function:

      =FILTER(A2:B6,A2:A6=DATE(YEAR(A2:A6),MONTH(A2:A6)+1,0))

      I didn't understand what exactly you want to summarize.

  4. Hi Alexander, you help me with if i have the number of years and months how can get the first date,month and year for that range.
    Ex. if i want the calculate what the date was from 04 months from today, it should be 01-01-2021

    how can i apply that into excel ? if i add year and moth on 2 different cells and it has to return the date. considering excel date as today

  5. I want next month target to be automatically generated no matter what time of year we look at it. (target getting from table)

  6. I need to a formula for convert different date's of Month name with year

  7. I have expiration date and I need to find out expiration range like 0 to 3 Month or 3 to 6 Months in excel

  8. This is the date format ( 20201101 ) which I have right now. Tell me how to get my month name in Text Eg, "Jan"

    1. Hello!
      If I got you right, the formula below will help you with your task:

      =TEXT((--RIGHT(A2,2))*28, "mmm")

  9. HI There,

    I'm not incredibly advanced on excel and am having some trouble, not sure I can adequately explain my requirements.

    I have a large table of information that requires 3 sets of conditional formats that will highlight the entire line if affected by certain date ranges. And I can't figure it out.

    The cell I am working with is 'Shipment Period' which is based on the whole month.

    I need all line data, that:
    1. Falls before (past date) the current month e.g. 2021-02; to be highlighted pink/red
    2. Falls during the current month; to be highlighted green
    3. Falls after (future dated) the current month; to be highlighted orange

    Any assistance would be appreciated.

  10. I need to a formula
    that s will be start month from 16th and end of the next month 15th days
    For example 2/16 to 3/15.

    1. Hi,
      The information you provided is not enough to understand your case and give you any advice. What source data is used for this task? The expected result is two dates or text? Please describe your problem in more detail.

  11. How to calculate month + 3 days in excel

    1. Hello!
      If I understand your task correctly, check out this article to learn how to add days to date in Excel.
      If this is not what you wanted, please describe your problem in more detail.

  12. i want to see if cell a2 show 23.11.2020
    than i want to see cell b2 show 23.12.2020 how to write formula

  13. Dear Mam,

    When we calculate no. of months for by DATEDIF function, result obtained is incorrect.
    Please advise & suggest necessary formulas.

    Start date-1-July-21 (A1)
    End date-31-Dec-21 (A2)
    Formula =DATEDIF(A1,A2,"M")
    Result from function=5
    Correct result=6

    Thanks

  14. I just want to know how to change my date to April 1st

  15. Hello

    I have a series of dates in column B and a series of numbers in column L. I want to add the numbers when the month is October. I thought of

    =SUMIF(B2:B89,"MONTH=10",L2:L89)

    but it gives 0. What is the way to do it.

    Thank you

      1. Yes thank you that worked

  16. Hi.

    what function to used for converting 15-Oct-20 to Oct'20?

  17. hi

    i have numbers in a columnlike 1,2,6,7,,4,657,4986,343,113,4245, in another column i want a oformula whichh will find the result of number of months against the days

    1. Hello!
      I’m sorry but your task is not entirely clear to me. Could you please describe it in more detail? How are these numbers and dates related? What result do you want to get? Give an example of the source data and the expected result.

  18. Dear sirs, can I ask for a wee bit of your expertise since my own is not enough in this case?
    I am looking to do comparisons between quarters during the year but with the closing balance date fixed from previous year. Let me explain:
    E.g. QUARTER 4(b)=2020-12-31, QUARTER 3(c)=2020-09-30, Closing balance (QUARTER 4(a))=2019-12-31.
    I have created formulas for Q4(b) and Q3(c) (linked to another date cell with the help of your EOMONTH-functions on this page) respecively so that when Q4(b)=>Q1(b), Q3(c)=>Q4(c). But, i want the Closing balance date Q4(a) (ie. 2019-12-31) to remain the same during the year UNTILL the new accounting year starts. So when Q1(b)=2021-03-31, Q4(c)=2020-12-31 and Q4(a)=2020-12-31.
    In words, Q(b) and Q(c) change during the year where Q(a) remain the same with previous year's closing date, and it's only when the Q(b)/Q(c) year change as Q(a) changes closing date one year forward.
    I find the Q(a) value quite tricky to solve.

    Thank you and regards,
    Daniel

  19. There are different dates in excel in each cell. if date is 1st of any month then that should be changed to last date of previous month and if date is 2nd or any other from 2 to 31 then the date should change to last date of that month.

    please help with formula in excel

    1. Hello!
      If I understand your task correctly, the following formula should work for you:

      =IF(DAY(A1)>1,EOMONTH(A1,0),EOMONTH(A1,-1))

      I hope my advice will help you solve your task.

  20. Hello,

    May I know how to extract the last day of the month if there is only year and month mentioned in general format? For example, 2020-06? The answer I am looking for is 06/30/2020?

    Thanks,
    Prashant S

    1. Hello!
      If I understand your task correctly, the following formula should work for you:

      =EOMONTH(B1,0)

      Hope this is what you need.

  21. Hi,

    I am trying to calculate and convert the current month to "currentmonth" using today date and month.

  22. 01/04/2020, 10:15:00
    how to convert this in to month

      1. i have tried but i can't get the result, can you please give me the formula which will help me to get month when it appears in this format. 01/04/2020, 10:15:00

        1. Hello!
          You did not say anything about this, but I can assume that your date is recorded as text. Therefore, you need to remove the comma from it and convert it to a date. And then apply the MONTH function:

          =MONTH(DATEVALUE(SUBSTITUTE(D1,",","")))

          I hope this will help

          1. Thanks,
            So, there is no option without removing , in this format.

  23. Hi,

    I need your help.

    Column A = Completion of project (Date format: 01-Jul-2020)
    Column B = Invoicing Month (Month format: July 2020)

    Items completed within 1st - 25th of every month must be invoiced in that month itself and items completed from 26th-31st is to be invoiced the next month.

    Any ideas how I can set a rule so Column B is generated based on the dates automatically?

    1. Hello Sammy!
      The formula below will do the trick for you:

      =IF(DAY(A1)<26,A1,EOMONTH(A1,0)+1)

      Remember to set the date format in cell B correctly

  24. Correction: Martch duration = 22 days, April duration = 22 days, May duration = 11 days. Thanks.

  25. Hi Alexander,
    I have data as below:
    Task start_day end_day duration, d
    Task1 01/03/2020 15/05/2020 55
    I have to show task duration by month in the chart. How can I get data needed for chart? I need: Martch duration = 20 days, April duration = 20 days, May duration = 15 days. Thanks.

    1. Hello Ruta!
      I’m sorry but your task is not entirely clear to me.
      Please describe your problem in more detail. Include an example of the source data and the result you want to get. It’ll help me understand your request better and find a solution for you. Thank you.

  26. Sry I forgot to add the formula I'm using. =SUMIF(O6:O24, AN6, AJ6:AJ24)

  27. Hello,
    I have used the formula above and only changed the cells, however the result sum to $0. Do the cells need to be together to work because these are not.

    Thankyou

  28. in case if you got 00 your computer's language setup is the problem
    use this: =TEXT(A1;"[$-en-EN]HHHH")
    en-EN ---> add here the language's code you want to see
    HHHH ---> the version of MMMM (month full lenght) in your computer's language
    Your version can be checked in Format Cells - Custom ---> last two options

  29. I am doing a monthly billing spreadsheet where I have listed income by each month, this is along side the bill,amount, and due date. At the bottom I am wanting the extra money left from each month calculation, needing it to register which month it is and bring that months income amount - the current months bills. Example below.
    Due Date Bills Amount Month Wks Income(mthly)
    7th Car $365 January 4 $2000
    8th Netflix $13 February 4 $2000

    Total Monthly Expenses $478 Leftover ____?????_____

    1. Hello LeAnn !
      I’m sorry but your task is not entirely clear to me. For me to be able to help you better, please describe your task in more detail. Please specify what you were trying to find, what formula you used and what problem or error occurred.How is 478 calculated? Give more an example of the source data and the expected result.
      It’ll help me understand it better and find a solution for you. Thank you.

  30. hello. i have a question and it may be stupid if this doesn't exist in excel. :D
    is there a command/formula to change all the written month (ex: January) and change it to the next month (ex: February) rather than changing/typing it one by one. i wanted to make the changes faster since the 2 sheet file will be used for the entire year except the months have to be changed.

    thank you for your time. :)

  31. I need a format for if a date has is in the last month to return another cell and if its not in the past month to return blank

    1. Hello Ben!
      Using cell formatting, your problem cannot be solved. If you need a formula, describe in more detail all the conditions. Please describe your problem in more detail. It’ll help me understand it better and find a solution for you. Thank you.

  32. I am a registered dog breeder and I would like to create in excel a schedule for the litter. I cannot breed two litters in 18 months. How do input my last litter so when I look at it when the right month and year to breed her. I only have 3 dogs.if it's under this month, to show in red. Anyone can help?

    1. Hello!
      I’m sorry but your task is not entirely clear to me. You need to use conditional formatting. What data do you use in the table?
      For me to be able to help you better, please describe your task in more detail. It’ll help me understand it better and find a solution for you. Thank you.

  33. Currently using this [WEEKNUM(TODAY(), 1)-WEEKNUM(DATE(YEAR(TODAY()), MONTH(TODAY()), 1), 1)+1)] in a countif formula. However what would would i do if i wanted to have a month to date look. Ex Week 1 would just be week 1. and week 2 it would be week one + week two and so on.

    1. Hello!
      Your formula calculates the week number in the current month. But I don’t understand what else do you want to calculate? Explain in more detail so that I can help you.

      1. Hi alexander,

        Correct. Its currently calculating to look at the current week. IN my scenario I have bunch of dates all throughout the Month. And depending on the week i am in, i calculate how many of those dates fall within the same week that were are in. What i am wanting to do is to adjust that to give me a running total. For example, if i was in week 2 the current formula will just looks at all the dates that are in the second week and count those. Instead I'm wondering if we could alter the formula to look at all the past weeks of the month as well. So if we are in week 2, the formula would Look at week 2 + week 1. I hope i was able to clarify this.

        1. Hello
          If I understand your task correctly , if the date is written in cell C1, and the formula

          = WEEKNUM (C1,1) -WEEKNUM (DATE (YEAR (C1), MONTH (C1), 1), 1) +1

          in cell D1,
          then the condition for the counter of the desired dates

          = COUNTIFS($D$1:$D$99, D1) + COUNTIFS($D$1:$D$99, D1-1)

          I hope this will help, otherwise please do not hesitate to contact me anytime.

  34. Hi Alexander,
    I want to know the formula to get the particular day of every month in the given data.

  35. Hi Alexander

    This was very helpful for my first part of the task. I have now taken the month from a date and shown it as the Month in text. I now want to take that result and have it sequence monthly for 24 months across a row, but I am having trouble reference that result and indexing it across the columns. Can you advise?
    I am a beginner in Excel, so trying to learn what I can as I need it.
    Thank you!

    1. Hello Glenn!
      If I understand your task correctly, in cell A1 is your start date. In cell A2, write the formula

      =TEXT(EDATE($A$1,COLUMN()-1), "mmmm")

      After that you can copy this formula right along the row.
      If there is anything else I can help you with, please let me know.

  36. By using countif() I derive the total number of records of each branch as usual I want data regards specific month

    1. Hello Madhavi!
      Use the expression as a condition: MONTH(D1)=4 where D1 is the date cell.
      For me to be able to help you better, please describe your task in more detail. It’ll help me understand it better and find a solution for you. Thank you.

  37. I use a spreadsheet for monthly budget reports. Each month has a YTD column. The formula typically looks like this: ='[March 2019]MARCH 2019'!E3+'APRIL 2019'!B3
    In this example, April is added to March's YTD totals in that column. When setting up the sheet for 2020, I have been unable to get it to change the whole column of totals. It will only change one cell at a time although I have included all cells.

    1. Hello Gojo!
      Unfortunately, you have not written what you managed to change in your formula and what you did not manage to change. It is not clear enough what exactly is not working.
      Perhaps, there is a problem with the names of the files in your formula, but it is merely my assumption.
      Please describe your problem in more detail and I will try to help you.

  38. I have downloaded a data which is from Jan-2020 to mar 2020, like below:
    05/02/2020 06:09 - It is showing month as May
    1/31/2020 2:55 AM - This one is showing Jan
    1/29/2020 12:27 AM
    1/17/2020 6:47 AM
    1/16/2020 5:39 AM
    1/14/2020 7:46 AM
    06/01/2020 03:41 - This one showing as June 20202.
    I tried converting it into month through text formula, tried changing format through data tab to convert text to column, also manually tried custom formatting but no go.
    Please help me in rectifying this.

    1. Hello Himanshu!
      Please go to Format Cells, choose Number -> Custom Format and set
      mmm-yyyy;@
      to display the date as Jan 2020,
      mmmm;@
      to display the date as January.
      I hope you will find my advice helpful.

  39. I need to take a date from this format 3/31/2020 to the "31st day of March 2020". I have NO problem on the March 2020 part but HOW in the world can I get the st part of 31st ??? Also need the abbreviations for all days 1, 2, 3, ..... 29, 30, and 31. Like 1st. 2nd, 3rd, and so on. The Only workaround I can think of is to create a table or chart with all the possible numbers with abbreviations and then use vlookup or the new xlookup.

    Thanks in advance for any help or insight !!!

    1. Hello Carl!
      If I understand your task correctly, the following formula convert to ordinal date format:

      =DAY(A1)&IF(OR(DAY(A1) = {1,2,3,21,22,23,31}),CHOOSE (1*RIGHT(DAY(A1),1),"st ","nd ","rd "),"th")&TEXT(A1,"mmmm, yyyy")
      or
      =DAY(A1)&IF(OR(DAY(A1) = {1,2,3,21,22,23,31}),CHOOSE (1*RIGHT(DAY(A1),1),"st day of ","nd day of ","rd day of "),"th day of ")&TEXT(A1,"mmmm, yyyy")

      I hope it’ll be helpful.

  40. Hello Michael!
    Please use the following formula
    =DATE(YEAR(A1)+2, MONTH(A1)+9, DAY(A1)+0) or
    =DATE(YEAR(TODAY())+2, MONTH(TODAY())+9, DAY(TODAY())+0)
    We have a ready-made solution for your task. I'd recommend you to have a look at our Ablebits Tools - Date&Time Wizard.
    This tool is available as a part of our Ultimate Suite for Excel that you can install in a trial mode and use for 30 days for free: https://www.ablebits.com/files/get.php?addin=xl-suite&f=free-trial

  41. Hello,
    I have calculated the number of year and months in excel. Now I am trying to get Excel to tell me what month and year that will be from now. For example, my car note will be paid off 2 years and 9 months from now, March 29, 2020. How can I get excel to tell me that 2 years and 9 months from now will be in December 2022? I thank you for your help with respect to resolving this issue in advance.

  42. I need a formal that if a month has 31 days it will displace from cell D5 and if then displace from cell D4. the month is in A1. Can you help me, please?

    1. Hello, Brenda!
      If I understand your task correctly, the following formula should work for you:

      =IF(DAY (EOMONTH (DATE(2020,A1,1),0)) = 31, D5, D4)

  43. Thanks a lot for your information. I have an issue to convert the following text date to a real date type.
    Jan 02, 2018
    Would you help on how I can convert it to date type? I've tried "=date(RIGHT(A2,4) LEFT(A2,3) MID(A2,5,2))", but it doesn't work.

      1. =DATA.VALue(replace(replace(a2;".";"/");" de ";""))

  44. 01/01/2020 AMUH
    02/01 DLD
    03/01 AMUH
    04/01 ARASH
    05/01 DAFZA
    02/02/2020 AMUH
    04/02/2020 UTPM
    01/03/2020 UPTM
    07/03/2020 AMUH
    04/04/2020 AMUH

    HOW CAN WE CALCULATE MONT WISE

    KINDLY SHOW THE CALCULATION

  45. I have few date range with different months and year. I want to hight only date which are from January to June regardless year. Can you please help me for this?

    Example.
    04-12-2006
    05-06-2007
    20-08-2008
    05-01-2009
    09-11-2007
    25-06-2008
    08-01-2009
    24-06-2008
    01-02-2011
    17-11-2011
    24-09-2011
    05-09-2012
    30-09-2011
    24-09-2011
    04-07-2019
    04-01-2009
    31-12-2013
    01-12-2013
    01-12-2013
    01-12-2013
    22-01-2014
    25-06-2008
    01-12-2013
    17-02-2012
    01-12-2013
    12-03-2016
    12-03-2016
    12-03-2016
    12-03-2016
    12-03-2016
    12-12-2017
    07-05-2019
    10-07-2019
    10-06-2019
    05-07-2019
    05-07-2019
    29-07-2019
    28-09-2019
    from above dates I want to hightligh only dates from January to June regardless year.

  46. Hi,
    Struggled to understand this, =TEXT(A2*28, "mmmm"). Why multiply by 28?

    1. Hi Sam,

      Thank you for a very good question!

      In its internal system, Excel considers the number 1 as Day 1 in January 1900 (when used together with month format codes such as "mmm" and "mmmm"). By multiplying the numbers 1, 2, 3 etc. by 28, you are getting Days 28, 56, 84, etc. which are in January, February, March, etc. Multiplying by 29 will also work.

      I've also added this explanation to the tutorial for other readers.

  47. I am facing a problem that I am using to display a stacked bar chart with "Time" as the timeline. However, I don't know how to make the x-axis (timeline) to display 1st day of each month. Any idea?

  48. hi
    i have one question, i have the calendar in excel and i am entering holidays next to the particular date. when i change the month, how i can clear the my holiday entries automatically.
    thanks

  49. Problem solved:
    I used this-
    =AND(MONTH($A1)=MONTH(TODAY()),YEAR($A1)=YEAR(TODAY()))

    1. Problem solved:
      I used this-
      =AND(MONTH($A1)=MONTH(TODAY()),YEAR($A1)=YEAR(TODAY()))
      Now I want the rest of the date should be highlighted in yellow colour. I mean if the month and the year is less than or more than today's month and the year it should be highlighted in yellow colour.

  50. I have different dates in column A1 (1-Oct-19, 15-Oct-19,29-Oct-19, 12-Nov-19, 26-Nov-19, 10-Jan-21 and so on). I want to highlight only the current month in green and the rest of the month in the red. I mean before and after Jan in the red and Jan (Current Month) in green.

    1. Example 1. Highlight dates within the current month
      =MONTH($A2)=MONTH(TODAY())
      Through this, if year changes it is highlighting the same month also. How can I highlight the date within the current month and year?
      10-Jan-20, 15-Jan-21
      It will highlight both cells. When the year is 2020, it should not highlight the year 2021.

Post a comment



Thank you for your comment!
When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to
your query. We cannot guarantee that we will answer every question, but we'll do our best :)