How to calculate working time in Google Sheet - time

I have a task to calculate the working hours in Google Sheet.
Below is my sheet screenshot, where I am facing an issue if the logout time is in AM.
Example:
Current Formula:
=(hour(D6-C6-E6)*60 + minute(D6-C6-E6))/60

=IFERROR((HOUR(D6-C6-E6)*60 + MINUTE(D6-C6-E6))/60,
((HOUR(D6+5000-C6-E6)*60 + MINUTE(D6+5000-C6-E6))/60)+12)

Please try:
=24*(D6-C6-E6+(D6<C6))
Perhaps formatted as Number to two decimal places.

Related

Excel cube: create new measure as sum of existing measures

I have no idea what to put in the formula box, and the help (https://support.microsoft.com/en-us/office/create-a-measure-in-power-pivot-d3cc1495-b4e5-48e7-ba98-163022a71198?ns=excel&version=90&syslcid=1033&uilcid=1033&appver=zxl900&helpid=149601&ui=en-us&rs=en-us&ad=us) says simple enter a formula.
Is there any documentation?
Neither
=SUM(dsv_FactIncome[ClientValue], dsv_FactIncome[PartnerValue])
nor
=SUMX(dsv_FactIncome[ClientValue], dsv_FactIncome[PartnerValue])
are acceptable to it, either.
This is DAX and your syntax is incorrect. Try
=SUM(dsv_FactIncome[ClientValue]) + SUM(dsv_FactIncome[PartnerValue])

Google Sheets - Split Formula

I have a sheet where we paste values copied from a pdf into a column, such as:
2715411.0 28.10.2021 600.00
In Google sheets there are columns with formulas that split these values, one of each is:
=ArrayFormula(INDEX(SPLIT(REGEXREPLACE(C2:C274, "\s", "♥"),"♥"),ROW(C2)-ROW(C2),1))
This formula is returning "2715411" instead of "2715411.0". I've tested the formula if the value was "2715411.1" and it works so I'm assuming it's because the number is being "rounded".
Another thing to take into consideration is that sometimes the number we paste is something like "32434346 28.10.2021 600.00" so having always decimal places can't be the answer.
Can anyone help?
Thank you in advance.
=ArrayFormula(SUBSTITUTE(SPLIT(SUBSTITUTE(C2:C274,".","♦")," "),"♦","."))

Possible to have a simple formula within the [value_if] argument? - excel

I'm trying to use a relatively basic IF function but having no luck - i'm sure i just have brackets or parenthesis wrong or something. Reckon it will be childsplay for you guys....
The formula is intended to show how many days a date has passed by. Date is shown in T column.
Basically it was working fine as the following, both for pending and past dates:
=IF(T7<=TODAY(), (TODAY()-T7),-(T7-TODAY()))
But I got greedy and wanted it to return more of a statement when the date has passed, as to how much it has passed by. So I've tried to make this happen with:
=IF(T7<=TODAY(),"EffOut(TODAY()-T7) days ago",-(T7-TODAY()))
Hoping it would enter "EffOut 8 days ago" (when TODAY()-T7 is 8 days) for example.
But it doesnt - it shows the entire argument i.e "EffOut(TODAY()-T7) days ago" in the return cell.
Is it possible to have a kind of embedded formula in the 'value_if' fields, mixed with text in this sense?
Happy to share the document if that would help, but will need to clear the data first so just let me know.
Thanks in advance, any help is much appreciated! Having read other posts I think it will just be a simple fix but its well beyond me! (I only got this far by perusing forums...)
Maybe something like this...
=IF(T7<=TODAY(),"EffOut "&DAYS(TODAY(),T7)&" days ago",-(T7-TODAY()))
=IF(T7<=TODAY(),"EffOut "&(TODAY()-T7)&" days ago",-(T7-TODAY()))
You just need to be careful to put "" around any strings. This is how Excel knows that's not a part of the formula. Remember to out the spaces is to the string like I did above so it looks like a sentence. The & sign combines the results of the calculated parts and the strings.

Excel formula debugging - Median calculation

I need help in proper formula formatting/syntax. I just haven’t been able to debug my formula to calculate a Median. Here is a working formula that calculates an Average:
=AVERAGEIFS(OFFSET(INDEX(date_city!1:1,MATCH("Price Per SF",date_city!1:1,FALSE)),0,0,COUNTA(INDEX(date_city!1:65521,,MATCH("Price Per SF",date_city!1:1,FALSE))),1), (OFFSET(INDEX(date_city!1:1,MATCH("Date of Sale",date_city!1:1,FALSE)),0,0,COUNTA(INDEX(date_city!1:65521,,MATCH("Date of Sale",date_city!1:1,FALSE))),1)), ">" & Criteria!$F$4, (OFFSET(INDEX(date_city!1:1,MATCH("Date of Sale",date_city!1:1,FALSE)),0,0,COUNTA(INDEX(date_city!1:65521,,MATCH("Date of Sale",date_city!1:1,FALSE))),1)), "<" & Criteria!$G$4)
I need to modify the above so it calculates a Median.
I’ve tested this simpler formula for proper format and it works:
{=MEDIAN(IF((date_city!$I$2:$I$989>Criteria!$F$4)*(date_city!$I$2:$I$989<Criteria!$G$4),
date_city!$E$2:$E$221))}
I need to replace *date_city!$I$2:$I$989* and *date_city!$E$2:$E$221* from the above Median formula with their corresponding code from the Average formula.
I tried this code, but cannot find my errors. Probably incorrect parantheses or comma placement.
=MEDIAN(IF((OFFSET(INDEX(date_city!1:1,MATCH("Date of Sale",date_city!1:1,FALSE)),0,0,COUNTA(INDEX(date_city!1:65521,,MATCH("Date of Sale",date_city!1:1,FALSE))),1)) ">" & Criteria!$F$4)*(OFFSET(INDEX(date_city!1:1,MATCH("Date of Sale",date_city!1:1,FALSE)),0,0,COUNTA(INDEX(date_city!1:65521,,MATCH("Date of Sale",date_city!1:1,FALSE))),1)) "<" & Criteria!$G$4), OFFSET(INDEX(date_city!1:1,MATCH("Price Per SF",date_city!1:1,FALSE)),0,0,COUNTA(INDEX(date_city!1:65521,,MATCH("Price Per SF",date_city!1:1,FALSE))),1)
Thanks in advance for any help.
FormulaDesk can display your formula in a way that is very easy and quick to understand, rolling-up nested parts together with their results. It should also pinpoint exactly where the error is.
[Disclosure: I am the author of FormulaDesk]

Validate Start Time With Current Date In Sharepoint?

I have a column called Start Time (it's a SharePoint Default Calendar Column). I need to validate if the Start Time is less than today or not? Without using javascript? Is this possible?
I have tried this:
Created a column called Today type as Date and Time.
Default value is current date.
Then compared the Start Time and Today in validation settings like the following:
=[Start Time] < [Today]
it seems not working. help please?
Try this code instead of yours
=[Start Time]<NOW()
I use this to validate that Start Date must be less than or equal to Today:
=[Start Date]<=Today()
...and it works for me.

Resources