importdistributors

Senior member
Sep 14, 2004
294
0
0
Hey all,

I need a to set a spreadsheet up. Lets say that In the a column are start dates, and in the b column are end dates. I need an if statement or formula that checks to see if all the start dates are the same, and all the end dates are the same then to calculate in cell C1 the number of years. And if there are different start dates but the same end dates for it to say "co-termed to (end Date)"

Anyone have any ideas to get me started?
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,836
4,815
75
Well, first of all, you probably need two more columns, D and E, filled starting at row 2 with formulas that check that =A1=A2 and =B1=B2 respectively. (Edit: To be clear, row 3 would have =A2=A3, etc.)

Then AND(D2:D65536) tells you whether all the start dates are the same, and likewise for column E and the end dates.

As for years, dates are stored as days from 1/1/1900, I believe. Would it be precise enough to calculate =ROUND((B1-A1)/365.25,0)