dcunningham
Board Regular
- Joined
- Jul 14, 2015
- Messages
- 58
Hi Everyone,
I have a list of asset IDs and service dates. I'd like to find the last service date and the next service date for a specific asset. The way I tried it was to use a formula like this:
This would be to find the last service date, and I'd use 'MAX' in place of 'MIN' for the next service date. The problem is that my list contains dates before the last service date and after the next service date, so I wind up with dates far in the past and far into the future. I think the way to fix this would to be to use =TODAY() to get the current date, and use logic that says "maximum date for this asset less than or equal to current date" for the last service date and "minimum date for this asset greater than or equal to current date". I just don't have the familiarity with Excel's functions to make this work.
Any help you can provide with this would be greatly appreciated.
Thanks,
Dan
I have a list of asset IDs and service dates. I'd like to find the last service date and the next service date for a specific asset. The way I tried it was to use a formula like this:
Code:
{=IF(MIN(IF(Lists!$J$11:$J$31 = 'Action Overview'!A2,Lists!$K$11:$K$31))=0,NA(), MIN(IF(Lists!$J$11:$J$31 = 'Action Overview'!A2,Lists!$K$11:$K$31)))}
This would be to find the last service date, and I'd use 'MAX' in place of 'MIN' for the next service date. The problem is that my list contains dates before the last service date and after the next service date, so I wind up with dates far in the past and far into the future. I think the way to fix this would to be to use =TODAY() to get the current date, and use logic that says "maximum date for this asset less than or equal to current date" for the last service date and "minimum date for this asset greater than or equal to current date". I just don't have the familiarity with Excel's functions to make this work.
Any help you can provide with this would be greatly appreciated.
Thanks,
Dan