How to subtract date only format mm dd in excel

0 votes
My date information was retrieved from our system without the year and in the format "mm/dd".

As a result, when I decrease the value between the previous and current years, I run into an issue.

Example: Date action Date Check Result Current Date
12/21 01/03 -352 03/18/2022

The correct result is: Date action Date Check Result Current Date
12/21 01/03 13 03/18/2022

How to subtract correctly?
Dec 25, 2022 in Others by Kithuzzz
• 28,900 points
56 views

1 answer to this question.

0 votes

I suppose Excel has handled December 21 and January 3 as dates, but that it has always assumed the current year. From cell A2, this subtracts one year.

=DATE(YEAR(A2)-1,MONTH(A2),DAY(A2))

For instance, check to see if the earlier date is one month earlier than the later date; if not, subtract one year from the earlier date and then compute the difference.

  +------------+------------+------+
  |      A     |     B      |   C  |
1 |   earlier  |   latter   | diff |
  +------------+------------+------+
2 | 2022-12-21 | 2022-01-03 |   13 |
  +------------+------------+------+

in cell C2

=IF(MONTH(A2) > MONTH(B2),B2-DATE(YEAR(A2)-1,MONTH(A2),DAY(A2)),B2-A2)
answered Dec 25, 2022 by narikkadan
• 53,520 points

Related Questions In Others

0 votes
1 answer
0 votes
1 answer

How to format numbers as lakhs and crores in excel/ google spreadsheet when the number could be negative too?

Excel formatting, in my opinion, can only ...READ MORE

answered Oct 31, 2022 in Others by narikkadan
• 53,520 points
1,462 views
0 votes
1 answer

How to format numbers in excel in crores or lacks

Try this: =TEXT(A1/10000000,"#,### \cr") READ MORE

answered Nov 6, 2022 in Others by narikkadan
• 53,520 points
115 views
0 votes
1 answer

How do I set the default paste special in excel to paste only values

I paste the values with a keyboard ...READ MORE

answered Nov 6, 2022 in Others by narikkadan
• 53,520 points
470 views
0 votes
1 answer

Change date format of cell in excel from dd.mm.yyyy to yyy/mm/dd ( excel version 2013 )

Hello :)   Excel’s Format Cells function can quickly ...READ MORE

answered Feb 9, 2022 in Others by gaurav
• 22,960 points
685 views
0 votes
1 answer

Calculate Birthdate from an age using y,m,d in Excel

Hello, yes u can find your birthdate using ...READ MORE

answered Feb 16, 2022 in Others by Edureka
• 13,630 points
215 views
0 votes
1 answer

Calculate Birthdate from an age using y,m,d in Excel

Hi To Calculate the date, we can ...READ MORE

answered Feb 16, 2022 in Others by Edureka
• 13,630 points
395 views
0 votes
0 answers

Convert Rows to Columns with values in Excel using custom format

1 I having a Excel sheet with 1 ...READ MORE

Feb 17, 2022 in Others by Edureka
• 13,630 points
177 views
0 votes
1 answer

How to change two different date format into single date format in excel

With data in A2, in B2 enter: =IF(ISNUMBER(A2),A2,DATE(LEFT(A2,4),MID(A2,6,2),RIGHT(A2,2))) and apply your format ...READ MORE

answered Dec 24, 2022 in Others by narikkadan
• 53,520 points
54 views
0 votes
1 answer

How to subtract dates in Excel with different date formats?

You can use dates in any computation ...READ MORE

answered Dec 29, 2022 in Others by narikkadan
• 53,520 points
63 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP