Monday, December 12, 2011

Working with advanced date calculations?

I'd like a cell in Excel to calculate "difference of two date cells" when the two cells have data entered. Plus, the cell should also be calculating from start date up to today's date(reflecting number of days so far) and should stop when stop date has been entered. Doing this, I should be able to know how many days have been consumed so far. It should also stop counting when the stop date has been entered. I am building an excel spreadsheet for recording working days. The employee can add a START and END date for each transaction. I would like the days cell to start calculating when the START date is entered reflecting how many days consumed up to date, and stop calculating when the END date has been entered. Is it possible? Any answers are highly appreciated for I am in a big mess tracking numerous transactions|||Assuming the start date is in A1 and the end date in B1





=NETWORKDAYS(A1,IF(B1="", TODAY(),B1))





The above formula uses the NETWORKDAYS function, with does not count Saturdays and Sundays (and any holidays you want to include). You might have to format the cell as a number.





If you want the formula to count all days including weekend days, then use the formula below





=IF(B1="",TODAY(), B1)-A1+1

No comments:

Post a Comment