In this values ( value1, value2, value3…) can be an array, reference to an array, number, or reference to a number.Īssume cell D5 contains our duration formula result. In the MAX function, we can use multiple values like value1, value2, value3… In this case, if you want to return 0, you can use the MAX function with the above formula as below. This formula would return a negative duration, i.e. When you subtract a duration from duration in Google Sheets, sometimes the result will be negative values.Īs an example, let’s use duration 1 in place of duration 2 and duration 2 in place of duration 1. To format this numeric value to duration, go to the menu Format and apply Number > Duration. When you subtract a duration from duration as above in Google Sheets, you will get a numeric value (as per our example it will be 1.493055556), not a duration. Needless to say, to hard-code both the durations in the formula, use the VALUE function with both the durations as below. Do not use the TIMEVALUE function instead of the VALUE function as it may cause a wrong answer. I have used the VALUE function with the second duration as per the syntax VALUE(text). You will get the subtracted value 35:50:00. We want to hard-code the duration 2 in the formula and subtract the duration 2 from duration 1. What about when you want to hard-code either of the values into the formula?įor example, as earlier, here also the duration 1 is in cell D3. If you want to subtract the D4 duration from the D3 duration, you can simply use the below formula. Example to Subtract a Duration from Duration in Google Sheetsįormula When the Values Are within Two Cells:Īssume you have the total duration values in two cells and the cells are D3 and D4. Related: Query to Calculate Hours Worked in Week Wise in Google Sheets. I mean we have two total durations and we want to do the calculation, here subtraction, based on it. Here we are just concentrating on the total duration. If you want either of the values or two of the values are hardcoded in the formula, then some of you may face issues.Įarlier we have learned how to group and sum a duration column using Query. Subtract a duration from duration is simple if the values are in two cells in Google Sheets.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |