I have this in a duration format: 29:30:00, and I want to convert it to a number so I can multiple it. ie, if it is 29:30:00, it will be converted to 29.5.
What is the easiet way to make it?
Thanks in advance
Try this formula (assuming your duration value is in cell A1):
=VALUE(A1)*24
Related
I have an inventory sheet, where I need to calculate the difference between the actual value and the series of expected values. Here is a snapshot of what I am talking about:
So for Item1:
Current: 50
Expected: 45,45,45
Now I want to devise a formula that will calculate a difference until the last column in this specific row, something like this:
difference = 50-(45,45,45) //50-45+50-45+50-45 and so on (Q,R..)
difference = 15 //final result
Is there any way that we can achieve this by putting formula in a cell, any help would be much appreciated, thank you.
In google-sheet you can use-
=ArrayFormula(SUM(M2-N2:P2))
In excel use below formula
=SUM(M2-N2:P2)
In case of non 365 version of excel you need to enter it as array means confirm by CTRL+SHIFT+ENTER.
Looking to make a fraction of an hour format with commas I've tried to format but couldn't figure out how, if anyone can help it would be appreciated
Like Hour,FractionOfHour
New Image:
duration:
=IFERROR(1/(1/(SUM(F3:J4)/60/24)))
decimal:
=IFERROR(1/(1/(SUM(F3:J4)/60)))
demo sheet
Not sure if I understood your question correctly, but here is the solution to display the time as a decimal
=HOUR(A1)+MINUTE(A1)/60+SECOND(A1)/3600
or
= TIMEVALUE(A1) * 24
where in cell A1 is time
I'm using the function importhtml() on my Google Sheets :
=IMPORTHTML("https://fbref.com/fr/comps/13/Statistiques-Ligue-1";"table";3)
The data are imported but some data are displayed "01.08" and the value is a date. The other values are ok if they contains big number like 1.93. How it's possible to change that and have only numbers and not displayed that value as a date ?
I try to change the format of the cell but the value became a number like 44455.
This is a screen of what I have
Just with the importHTML without any cell formatting
After I format the cell as brut text
How can I have the value as a number so to display 1.08 and not 01.08 ( for Google SHeets this is a date )
Thanks a lot in advance
Just add a fourth parameter, which stands for locale.
=IMPORTHTML("https://fbref.com/fr/comps/13/Statistiques-Ligue-1";"table";3;"en_US")
This solved the problem here, since it turns the decimal points into commas, not allowing GS to interpret it as date format.
I am trying to use this formula in google spreadsheet (B2 is a date, eg. 27.11.2020):
=IF(WEEKNUM(now()) = WEEKNUM(B2),"yes","no")
For some reason this is not possible.
When using only:
=WEEKNUM(now()) = WEEKNUM(B2)
I do get TRUE/FALSE, but I need to be able to convert the TRUE/FALSE to YES/NO.
Why does not this work and are there any alternatives?
Issue:
As you can see in the following screenshot or in the documentation:
WEEKNUM accepts a date object but you are passing a string 27.11.2020.
Solution:
You need to convert 27.11.2020 to an actual date object.
You can do that by using this formula:
=IF(WEEKNUM(now()) = WEEKNUM(date(right(B2,4),mid(B2,4,2),left(B2,2))),"yes","no")
You can use the following
=IF(WEEKNUM(now())
=WEEKNUM(REGEXREPLACE(B1,"\.","/")),"yes","no")
OR
=IF(WEEKNUM(now())
=WEEKNUM(SUBSTITUTE(B1,".","/")),"yes","no")
The above formulas work for both European as well as USA formats.
Functions used:
REGEXREPLACE
SUBSTITUTE
IF
I have a Spreadsheet with duration values in one column, and date values in another.
I want to sum duration values based on a particular day of the week... eg, in the example screenshot, the first and last dates are Friday. So I want a formula that would add the duration values from the corresponding cells... a total of 17:00
I've tried a formula like this. But this doesn't work.
=SUMIF(D:D, CHOOSE(WEEKDAY(DATE(),2), "Fri") , A:A)
You could try:
=sumproduct(weekday(A:A)=6,D:D)
try:
=TEXT(ARRAYFORMULA(SUMIF(WEEKDAY(A:A, 11), 5, D:D)), "[h]:mm")
Not sure if there is an easy way because I'm noob at Google Sheets, but try with array formula:
=ArrayFormula(SUMIF(D1:D3;WEEKDAY(A1:A3;2);5))
Using it as array formula, I got this:
Hope this helps
One approach to do this is the following:
In column E put the weekday values. Use WEEKDAY() function which depending on your setting will make Friday any integer between 1-7. If using default Friday will be "6".
Use the SUMIF() function. Eg.=sumif(E:E,"=6",D:D)
Make sure the cell where your SUMIF() formula resides, also has a duration number format.