subtract 2 dates if range varies depending on values in other column

subtract 2 dates given that the range of dates between both values is less than 61days. 
ie: range= 
01/02/2015
05/02/2015
27/02/2015
25/03/2015
25/06/2015

as there are less than 61days from 01/02 - 25/03 you would calculate the number of days between these 2 dates. 
This means the range is always varying.
Similarly, as you apply the formula down the rows, it would also give you the difference between 05/02-25/03 and 27/02-25/03

Meaning, in column A there's a set of products. I want to calculate this difference between dates for each product separately. Say Product 1 goes from A1:A3; Product 2 might go from A4:A89 meaning that the range of dates determined by the products, always varies.

August 14th, 2015 2:37am


Meaning, in column A there's a set of products. I want to calculate this difference between dates for each product separately.

- I assume that the dates are in column B.

- Create an unique list of all products in column D
- Use this formulas in the mentioned cells:

E1:  {=INDEX(B:B,MIN(IF(A:A=D1,ROW(1:100))))}
F1:  {=INDEX(B:B,MAX(IF(A:A=D1,ROW(1:100))))}
G1:  =F1-E1

E1 is the min. date for product in D1
F1 is the max. date for product in D1
G1 is the difference

Drag the formulas down to the end of your data.

Andreas.


Free Windows Admin Tool Kit Click here and download it now
August 14th, 2015 9:06am


Meaning, in column A there's a set of products. I want to calculate this difference between dates for each product separately.

- I assume that the dates are in column B.

- Create an unique list of all products in column D
- Use this formulas in the mentioned cells:

E1:  {=INDEX(B:B,MIN(IF(A:A=D1,ROW(1:100))))}
F1:  {=INDEX(B:B,MAX(IF(A:A=D1,ROW(1:100))))}
G1:  =F1-E1

E1 is the min. date for product in D1
F1 is the max. date for product in D1
G1 is the difference

Drag the formulas down to the end of your data.

Andreas.


August 14th, 2015 1:05pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics