• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Same occurence and the time that elapsed.

chipgiii

New Member
I have data for a greenhouse - specifically each time a bulb or ballast is changed. There are over a thousand lights, each has a unique identifier. Each week the data is updated. There are hundreds of rows. I want to add a column that looks up the unique identifier, takes the most recent repair date (another column in the file), and subtracts the previous repair date for the same unique identifier. This would give me a time between repairs. Make sense?
 
=LARGE((IF(A:A=D1,B:B)),1)-LARGE((IF(A:A=D1,B:B)),2)


the formula assumes all the unique ids are in column A, the dates are in column B and the unique id you are searching for is in D1


Should be entered as an array formula Ctrl+Shift+Enter
 
Vaskov17,


It isn't working. Not sure why though. I broke the formula in half and just went after the Large, 1 to see if it selected the largest date. It does. I then went to Large, 2 to see if it selected the second largest date, it doesn't. It continues to select the largest.


Beginning to think this might be more difficult than first thought.
 
The difficulty is it is selecting the largest date in the data sheet regardless of unique identifier. I even tried Large, 1, 2, 3, 4, etc. There are multiple lights replaced on any given day so there are always duplicate dates, but not duplicate identifiers. I was hoping a formula would be possible. My first thought was a sumproduct type thing. Right now I have the data in a pivot so I can see each time according to date when there was "same" light replaced. I may just go with this, not what I was hoping but it's doable.


Thanks for your help.
 
Back
Top