Oct 18 2022 06:25 AM
Afternoon,
I'm trying to get cells in column E to perform a function and calculation based on particular text in column A.
My objective is to calculate the time taken (between two dates Column B and C) but for "completed" (Column A) tasks only. However, if Column A reads “Pending” then I want to display 0 (zero) in column E)
A | B | C | D | E | |
1 | Date Entered | Complete date | |||
2 | Complete | 01/02/2022 | 05/06/2022 | 131 | |
3 | Pending | 01/02/2022 | - | 0 |
Any support / suggestion would be amazing.
Oct 18 2022 06:46 AM
Hi Mark, your task can easily be done with IF(). Since dates in Excel are actually formatted numbers, you can simply subtract the two dates from each other.
Enter the following formula in E2. The result will automatically continue downwards.
=IF(A2:A3="Complete",C2-B2,0)
Oct 18 2022 07:26 AM
Oct 18 2022 07:42 AM
You're right! A clerical error on my part.
=IF(A2:A3="Complete",C2:C3-B2:B3,0)
If you only
=IF(A2="Complete",C2-B2,0)
you have to copy the formula down.