Largest period between two dates

damian_r_Home

Board Regular
Joined
Jan 8, 2005
Messages
231
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
Morning All.
I have a column tha thas dates in it. These dates are not a text entry, but a value from another cell by a basic formula - see below
=IF(C14="Y",A14,"")

How do you write a formula that can look down this column of dates and then see what the largest period is between any two dates is and show that value in days?
There are many many empty cells in the column.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
If the formula is in column D : =MAX(D:D)-MIN(D:D)
 
Upvote 0
I'm not really sure what you want. But try this:
(if this is wrong, then please post your data and expected results. Making the forum guess what your scenario is wastes time and does not help you.
Mr Excel has a tool called xl2bb add in (link below) that allows you post miniworksheets. If you cant use that tool then post your data as a table. As you can see you have two very different suggestions, and both could be wrong. I'm pretty sure i'm wrong because my solution is not a Max of the resulting values.)

Cell Formulas
RangeFormula
E14:E23E14=IF(C14="Y",A14,"")
F14:F22F14=IF(OR(E14="",AND(ROW(E14)=23,COLUMN(E14)=5)),"",NETWORKDAYS.INTL(E14, INDEX(E15:$E$23,1/MAX(IFERROR(1/(ISNUMBER(E15:$E$23)*(ROW(E15:$E$23)-ROW(E14))),0))),"0000000"))
F23F23=IF(OR(E23="",AND(ROW(E23)=23,COLUMN(E23)=5)),"",NETWORKDAYS.INTL(E23, INDEX(E$23:$E24,1/MAX(IFERROR(1/(ISNUMBER(E$23:$E24)*(ROW(E$23:$E24)-ROW(E23))),0))),"0000000"))
 
Last edited:
Upvote 0
Another option
Excel Formula:
=LET(f,FILTER(E2:E200,E2:E200<>""),MAX(DROP(f,1)-DROP(f,-1)))
 
Upvote 0
Afternoon.
Thanks for your replies, I will try them out later this evening and see what happens.

D
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,687
Members
449,117
Latest member
Aaagu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top