Calculate time in all countries for fixed time in one of them - excel

I have table with all countries GMT/UTC timezones, I need to see what time is in the rest of the countries when in USA is 11am-3pm
Not on particular date just know the difference in time.
I did my calculation like that I -5 GMT in USA and time is 11am then in Russia for example is +4 GMT.
5+4+11=20pm in Russia when USA is 11am, this works with countries that have + GMT zone but ones that have minus it shows wrong time.
I am working in Excel; please help me with advice on how to do it.
I did it already for the +gmt timezones and yes I have times for cities in big countries too; it was not my question.
How can I find out what time zone is in country with -11gmt when in country with +8gmt is 11am?
Someone know?
E.g. I work with dates like this in Excel. I set type of cell data to date and put
1/1/11 4:30 (+4:30 gmt)
1/1/11 1:00 (+1:00 gmt)
Now I have a date e.g. 1/20/11 11:00 (11 am on imaginary date); all I need to do is
"1/20/11 11:00 AM" - "1/1/11 4:30 AM" = "1/19/00 10:00 AM" at (0 gmt)
10am I don't really care about date in this case just time. I cannot think right now how I gound precise time but it seems somehow work without even putting +8 gmt in there...
Anyway solution should look something like that.

What about countries that have more than one time zone?
11am in the USA....where? West coast (PST) or east coast (EST)?
How do you take into consideration daylight savings time?
There are a lot of things to consider to do time conversions correctly.
I personally wouldn't keep a table with country and hour conversions, but two tables. One with timezones and hours from GMT time. And then another one with city names and timezone mappings. This way instead of converting from USA to Russia, you would be converting from New York to Moscow.
I did do a quick search on timezones in excel, and I found this article. I hope that it helps.

Related

Excel formula to determine shipping date

Due to production and shipping issues my job has created a report that has the customer's need by date and if a product has been completed or not. If an order is complete we need to determine when it will ship out and arrive to the customer. We have a set shipping schedule and orders get shipped on the truck right before the need by date. For example our truck leaves on Monday and Friday every week so if an order is complete and the need by date is on a Wednesday it will ship on Monday so any order with a need by date from Tuesday to Friday gets shipped the Monday before and any need by date from Saturday to Monday gets shipped on Friday. Now my questions is, is there a way to have a date range yield it's shipping date? Example when I'm writing this it's 5/11/2022 so if I have completed orders with need by dates of 5/12 and 5/15 all of which should be on the 5/13 truck could I use a formula to fill in the shipping date for those need by dates? We've been doing it manually and although determining the dates isn't difficult it's time consuming when each report has over 3000 lines and there is a report for each customer. If it's not possible then we won't have a choice but I would like to hope so. Please help.
The third column is just to show that the ship dates are on the correct day. It looks different because the dates are Australian (DD/MM/YYYY) rather than American (MM/DD/YYYY), but that shouldn't matter for the function to work.
The function in the Ship Date column:
=IF(OR(TEXT(A8,"dddd")="Tuesday",TEXT(A8,"dddd")="Wednesday",TEXT(A8,"dddd")="Thursday",TEXT(A8,"dddd")="Friday"),A8-WEEKDAY(A8,3),A8-WEEKDAY(A8+2,2))
Need By Date (including header) = A7:A20
Ship Date (including header) = B7:B20
Explanation
TEXT(value, format_text): this is used to convert the date (DD/MM/YYYY) to the long day (e.g. Monday)
Breakdown
IF the day is Tues, Wed, Thurs, or Fri
THEN return the date of that weeks Monday
ELSE return the date of that weeks Friday

Count for every 'x' that falls into an interval within a given time range?

I'm looking to get a headcount of people available every hour within a time frame.
Employee
Start Time
End Time
Emp name
8:30 AM
10:30 AM
Emp name
8:30 AM
10:45 AM
Emp name
8:00 AM
10:15 AM
If I were to take a count of employees available at 9:45 AM, I should get 3. Or maybe I want 15 minute intervals and want to know my headcount at 8:15, which would be 1.
Currently my solution is to make a table for every hour in a day using the following formula to add a tally for every hour an employee is available:
=IF(AND($G9>=R$1,$G9<S$1),1,IF(AND(R$1>$G9,R$1<$H9),1,""))
And i get something that looks like this:
Start Time
End Time
8:00 AM
9:00 AM
10:00 AM
11:00 AM
8:30 AM
10:30 AM
1
1
Finally I can pivot this or countif it to get my total.
Is there a more elegant solution to this? Preferably one that allows me to change the interval but still gives me an accurate count. Even better if I don't need to build out the interval table.
I'm open to using VBA or formulas.
Overall, what is this problem called? I'd like to look up a pythonic solution on my own time for some self study.
If every line represents a different employee, then just use COUNTIFS:
=COUNTIFS(B:B,"<="&E2,C:C,">="&E2)

Calculate amount of date ranges' overlaps

I try to store availability hours for different services. (Every work days (8, 9 hours), 24/7 etc.)
A work day can have different office times (08:00-16:00 or 09:00-17:00, 08:00-18:00 etc.)
There are also national holidays where a normal work day acts like a weekend, and any given weekend day can be also work day.
What is the best way to store this in a database (PostgreSQL)?
Background
The main goal is to calculate if how many minutes of a given time range is in service time.
A) A service time is only work days (08:00-16:00) and the date range is
[2019-10-21 15:00 (Monday) - 2019-10-22 09:00 (Tuesday)]. The whole range is 18 hours long, but only 2 hours were in service time.
B) I also want to calculate if I know the start time (2019-10-21 15:00) and there is 3 hours to finish the work (in work time) then when will be the end date? (2019-10-22 10:00 - 1 hour on Monday, 2 hours on Tuesday)
I would store the data exactly as how you described it.
You can have a table for work windows, i.e. Mon-Fri 08:00 to 16:00
And each service will have it's date ranges, start and stop. I'm guess a service will have multiple date ranges so you might need a date range table that has dateRangeId, start & stop columns.
When you want to calculate something, you pull data for the service and pull data for the work days and calculate what is the actual service time and any other questions you need answered :)

Excel - time of year/day/date/time to determine peak/offpeak

I'm looking for a formula in excel that lets me know if a date each date/time is peak or off-peak (electricity use data). Peak/off-peak is determined by the season, day of the week and time.
Peak equals:
JUNE-SEPTEMBER (SUMMER)
- mon, tue, wed thurs, fri and hour 9:00-18:00
OCTOBER-MAY (WINTER)
-mon, tue, wed, thurs, fri and hours 8:00-21:00
Off-peak - All other hours. (ie where this is false)
I have the code to determine if something is off/on peak individually:
June-September
IF(AND(WEEKDAY(A2,2)<=5,WEEKDAY(A2,2)>=1,A2-INT(A2)>=0.375,A2-INT(A2)<=0.75),"peak","off-peak"))
October-May
IF(AND(WEEKDAY(A2,2)<=5,WEEKDAY(A2,2)>=1,A2-INT(A2)>=0.333,A2-INT(A2)<=0.875),"peak","off-peak"))
However, my problem is I don't know how to put these together with a date like
01/02/2019 09:00 to do the first step to determine if it qualifies as SUMMER or WINTER. Would this be workable with a nested IF in excel? I can't seem to get this.
Making a separate column with an If statement that shows if the date is winter or summer is easy, and I've done it. But I still don't know how to combine this with the above functions.
Many thanks.
Excel - day/date/time to determine peak/offpeak
I want the output to just tell me peak or off peak, but the variable hours depending on the time of year is tripping me up.
Yeah nested if statements. If you've got your formula for SUMMER/WINTER in A1, then nest like this:
=IF($A$1="SUMMER",IF(AND(WEEKDAY(A2,2)<=5,WEEKDAY(A2,2)>=1,A2-INT(A2)>=0.375,A2-INT(A2)<=0.75),"peak","off-peak")),IF(AND(WEEKDAY(A2,2)<=5,WEEKDAY(A2,2)>=1,A2-INT(A2)>=0.333,A2-INT(A2)<=0.875),"peak","off-peak")))
The WEEKDAY function is really MOD(<date>, 7) with some adjustments. Using MOD, anything less than 2 is Saturday or Sunday.
The HOUR function quickly converts true time to an integer that can be compared to a set of paramters which are adjusted for summer/winter.
=IF(OR(MOD(A2, 7)<2, HOUR(A2)<(9-ISNA(MATCH(MONTH(A2), {6,7,8,9}, 0))), HOUR(A2)>(18+ISNA(MATCH(MONTH(A2), {6,7,8,9}, 0))*3)), "off-", "")&"peak"

Convert day, hour and minute to UTC - node.js

I will get time input from the user for scheduling a task. The options are as follows,
Day of the week, hour and minute (or)
Day of the month, hour and minute (or)
Month of the year, hour and minute (or)
User can be in any timezone. I have modeled my database table to store the user input as a configuration.
In my table I will calculate the next_run_at and populate it, so that poller can find the jobs to run based on it and execute.
To be timezone agnostic, my next_run_at should be in UTC.
Is there a way to convert the above mentioned configuration(Day, hour, minute) alone in UTC and store it?
TL;DR I know we can convert a date to specific timezone. Is there a way to convert the combination of just day, hour and minute alone to UTC?
Construct a date from the day, hours, and minutes you have. Convert it to UTC and get the day, hours, and months values back.
But I think there will be edge cases as to which month the day corresponds to.
23:00 28th Feb PST will be 06:00 1st Mar UTC;
23:00 28th Mar PST will be 06:00 29th Mar UTC
You asked:
Is there a way to convert the combination of just day, hour and minute alone to UTC?
No, there is not a general way to do that. You must have the full date and time, including year, month, day, hour and minute. Otherwise you cannot be certain if daylight saving time is in effect, or if the standard time has changed.
You will have to assume some of the data you don't have. For example, you could make an assumption that the data is relative to "now". Just understand you will get different results depending on when you run the code.
Of course, this doesn't apply if there's only a single fixed offset for the time zone in question, such as Arizona being fixed to UTC-7. Just you can't assume this in the general case of any time zone of the world.

Resources