Solution
Suppose total distance is in column C1
and total time is in D1
then average speed formula would be:
=C1/(int(D1)*24+hour(D1)+minute(D1)/60+second(D1)/3600)
int
function is the one I was after.
Instead of filter views, I would use the filter
command. For example, suppose Sheet1 holds raw data, with A being a character, B the list of "mentioned" chapters, and C the list of "appeared" chapters. You can then add another sheet for "filtered" data, where the user enters chapter number in, e.g., cell A1 and immediately get the list of rows matching that number thanks to the command
=filter(Sheet1!A2:C, regexmatch(Sheet1!B2:B,"\b"&A1&"\b") + regexmatch(Sheet1!C2:C,"\b"&A1&"\b"))
Here, each regexmatch
scans its column (B or C) paying attention to word boundaries (\b
) so that, e.g., "20,23,25" would not match "3". Addition plays the role of OR operator here.
If you are sharing this, you can allow editing but protect all cells except A1 on the second sheet: this way, the users can only change the chapter number for filtering.
There is a potential drawback: the changes to A1 are actual edits; i.e., what one user does affects everyone. If this is unacceptable, then filter views are the only option. You can circumvent the "OR" issue by creating a new column with
=B2&","C2
i.e., concatenation of columns B and C. Then apply filter views based on that column. However, the filter view will require either
- custom formula with regexmatch as above (not user-friendly at all)
- different format of data to make the condition "text contains..." work: for example, you could format as
,2,4,10,13,16,
so that the text to search for would be ,4,
(Otherwise, there's the same issue of "13" matching "3".)
Best Answer
try this: add 1 more column with
=COUNTIF(B2-A2,"="&"8:30")
and then you can sum this column with a formula:
=SUM(Sheet1!C1:C10)*8.50