I have a monetary value for 1 minute like 0,10 € (10 euro cents per minute)
In Google Sheets, I have a column to enter a length of time in minutes and seconds like "xx,xx", ex. 1,30
The calculation will be "duration" x "0,10 €". but…
In Google Sheets, what is the correct formula for calculating the monetary value of each elapsed time?
Here is a spreadsheet with example
Best Answer
First, you need to decide how you enter your duration values. Remember,
1,30 minutes
is not the same as1 minute and 30 seconds
- it is1 minute and 18 seconds
, since a minute is 60 seconds.If you insist on a format of
minutes,seconds
, you'll need a formula to parse this as a duration. I suggest using a regular expression. This formula will split aminutes,seconds
value inA2
into two cellsB2
andC2
:Having that, we can calculate a decimal number of minutes (so that
1 minute and 30 seconds
is displayed as1.5
minutes). Enter this formula inD2
:Now that we know that
1 minute, 30 seconds
equals1.5 minutes
, it is easy to calculate the charge. Let's put the minute charge in cellG1
, then, inC2
, enter:... which should display as
€0.15
.See the example spreadsheet I have set up.
Note: Instead of parsing a
minutes,seconds
string with regex, you might have some luck experimenting with Format → Number → More formats, and using the Elapsed minutes/Elapsed seconds placeholders, but the feature seems buggy and non-obvious.