20 Comments
 

its not working with the MM/DD/YYYY format.

I did

=DAYS360(MIN(A,B),Y) since I am trying to find the difference in MONTHS between the earlier of A and B .

Therefore, if A is earlier then B, I want:

A-Y

If B is earlier then A, I want :

B-Y

IN MONTHS is the KEY

 

May I ask why you're using the days360 function? If you're using data that is spread over over several years, you're going to see fairly significant deviations from the days360 function (which is based on a 360 day year) and just subtracting the dates (which will give the actual number of days in between). I think DrJoe's method is more accurate.

 

I will assume your dates are stored as dates, and not as text, etc. Check this by adding 1 to a date - it should show give you the next date.

If you want the difference in months, then it gets a bit tricky due to year ends. I think the following would work though.

The difference in months between X and Y is "=month(y) - month(x) + 12*(year(y) - year(x))"

Since you want x to actually be the minimum of A and B, replace X everywhere it appears with min(a,b). You might have to reverse the sign of the result, since in above posts you have been inconsistent about what you are subtracting from what.

Dr Joe

 

So let's do this, sorry but I'm new to excel.

A= 03/05/1980 B=04/05/1980 Z= 08/08/1993

I would need to do A-Z (A is March, B is April of 1980)

So what would my function be?

 

DrJoes works for this.

"=MONTH(8/8/1993) - MONTH(MIN(3/5/1980,4/5/1980) + 12*(year(8/8/1993) - year(3/5/1980,4/5/1980))"

Should be 9+144+8=161.

But obviously you'll be using this more than once so don't hardcode the dates, link them to the cells you'll be using and paste.

BUT...

I don't believe the above formula will be exact if DAY(x) greater than DAY(y). For the above you would get 161 even though technically it wouldn't be a full month from day 5 of 3/1980 to say day 20 of 8/1993 which would only be 160 full months.

Then you would need an IF clause. Where the above formula is F -

"=IF(DAY(y) greater than Day(x),F,F-1)"

Right?

 

Ok, tested it. This works to take care of the day issue.

J15=MIN(A,B) J21=Z

"=IF(DAY(J21)>DAY(J15),MONTH(J21)-MONTH(J15)+12(YEAR(J21)-YEAR(J15)),MONTH(J21)-MONTH(J15)+12(YEAR(J21)-YEAR(J15))-1)"

 
Best Response

Scrambles, I think you are technically correct as to how the formula should apply to the situation (coupon payments), whereas I am technically correct as to how the question was originally phrased. However, to be fully correct, you will likely need to add extra handlers for when the bond pays (for example, on the 15th of each month). I would suggest adding this in a previous formula as opposed to bundling it with this formula.

snands, I understand you said you are new to Excel, and we are glad to help, but put the entire problem out to us instead of bits and pieces. So if you need further assistance, tell us the inputs (the three dates, seemingly) and the output that you desire, as well as how you would manually compute it to make sure we are on the same page and not wasting our/your time. Do you need to account for discrete nature of the bond payments?

Also, just curious, did you use an alternative product before Excel, or are you simply new to spreadsheets? In any case, if you are working with bonds, you need to have everything discussed here internalized ASAP (by which I mean before you started working with bonds in the 1st place).

 

Another way could be to use YEARFRAC function.

Set up 4 columns. 1st column (C1): YEARFRAC(Min(A,B),Y) = 13.425 2nd column (C2): =YEAR(Z)-YEAR(MIN(A,B))-IF(MONTH(MIN(A,B))>MONTH(Z),1,0) = 13 {OP this is saying year 1993 - 1980, and if the minimum's month is after Z's month, you need to take away 1 to account for less than a year}

3rd column (C3): Round((C1-C2)*12,0) {This gives you # of months)

4th column = C2 x 12 months + C3 = 13*12 + 5 months = 161 months.

I did it in steps to show the OP the formula breakdown in an easier format, but I think the other guys' formulas in one step works too.

 

it's a actually a fixed income derivative. the question is relatively simple.

I have a column that says Adjustable Rate, and the cells are all "Y," or "N"

If it's adjustable, I need to calculate in months, the remaining term. Which I know is classified as, by my bank,

Earlier of NDate or MDate minus Ldate. The obvious trick here is the months, and If function.

So, for a different classification, where I had to calculate the fixed term as

ldate-mdate, i did

=IF(Cell1"N",((DAYS360(CellLdate,Cellmdate)/30),0

 

Figured out that question.......

QUICK excel question.

I have cells with months. 1 - 100 i believe

if it's less then three months, i need the cell to read "3m" 3 months-12 months "12M" 1 year to 3 years "3M" 3-5 years, 5y 5 yrs to 15 years, 15y, 15+ over 15.

 

Two things you can do - Match function or vlookups

To figure out match function, use the Excel help, it is pretty good on the topic. I prefer doing this using a distinct reference table. So create a new sheet and list out the possible numbers of months - 1 to 100, as you said. List each of them. Next to each, enter the description that corresponds to it - so next to 0,1,2 enter 3m, next to 3,4,5,.... 12 enter 12m and so forth. Then use a vlookup on the original tab.

 

Sapiente sed est ducimus commodi error quaerat animi sit. Autem assumenda adipisci magni omnis nam. Quas sed distinctio soluta quia vel et dolorem consequatur. Ratione quo ullam incidunt quod dolores.

In voluptas sequi ratione explicabo enim. Quidem enim eos impedit molestiae dolores voluptate. Tempora qui officiis possimus vel ullam. Culpa earum beatae vel sed debitis dolor sint maiores. Voluptatum dolorum sed quos.

Quo et omnis voluptas asperiores et. Omnis nihil sit laudantium sunt molestiae. Possimus cumque iusto ut provident aliquam. Non corporis consequatur provident tempora non alias labore.

Quaerat nulla amet illo dolor non tempore itaque. Facere tempore tenetur ad. Voluptatem dolores quaerat velit. Non qui aut aut aperiam possimus. Rem dolores non esse rerum blanditiis. Dolore tempore quas qui deserunt voluptas saepe est.

Career Advancement Opportunities

June 2026 Investment Banking

  • Evercore 01 99.4%
  • Moelis & Company 01 98.9%
  • JPMorgan 01 98.3%
  • Guggenheim Partners 01 97.7%
  • Morgan Stanley 07 97.1%

Overall Employee Satisfaction

June 2026 Investment Banking

  • Moelis & Company No 99.4%
  • Morgan Stanley 02 98.8%
  • Evercore 01 98.3%
  • BMO Capital Markets 12 97.7%
  • Banco Santander 01 97.1%

Professional Growth Opportunities

June 2026 Investment Banking

  • Evercore 01 99.4%
  • Moelis & Company 01 98.9%
  • Morgan Stanley 05 98.3%
  • JPMorgan No 97.7%
  • BMO Capital Markets 11 97.1%

Total Avg Compensation

June 2026 Investment Banking

  • Vice President (14) $434
  • Associates (44) $258
  • 3rd+ Year Analyst (8) $210
  • 2nd Year Analyst (22) $179
  • Intern/Summer Associate (13) $156
  • 1st Year Analyst (78) $151
  • Intern/Summer Analyst (73) $101
notes
16 IB Interviews Notes

“... there’s no excuse to not take advantage of the resources out there available to you. Best value for your $ are the...”

Leaderboard

success
From 10 rejections to 1 dream investment banking internship

“... I believe it was the single biggest reason why I ended up with an offer...”