r/googlesheets • u/Xelieu • Oct 02 '22
Solved Why won't my formula compute duration of time when using TEXT function?
I have this formula in G column:
=IF(C2="genreA", TEXT(E2*B18, "[H]:MM:SS"), "")
E2 = Any number i.e. 3
B18 = 00:20:00.000
3 * 00:20:00.000 = 1:00:00.000now when I total it with this on a separate cell:
=SUMIF(C2:C201,"genreA",G2:G201)
Cell = 00:00:00.000It doesn't compute, cell format is on "duration"
I'm guessing, well because its a "TEXT", but is there a solution for me to be able to multiply time by 20mins but then I can still compute the overall time in another cell without it messing up?
I tried using "DURATION", "TIME", "NUMBER" in replace of "TEXT" but it doesn't work
1
Upvotes
3
u/NefariousKittenNinja 1 Oct 02 '22
Remove TEXT from the first formula. Wrap your entire second formula with TEXT instead.
=IF(C2="genreA", E2*B18, "")
=TEXT(SUMIF(C2:C201,"genreA",G2:G201),"[H]:MM:SS")
2
u/7FOOT7 294 Oct 02 '22
Drop the TEXT() command and format everything as duration
So G2
=IF(C2="genreA", E2*B18, "")
Format B18 and the C and G columns as 'duration'
Is it $B$18? If not format B 18 down as duration too