Transforming Date data from one column to several 24row columns - excel

I have data output into one column by hour of day. I was wondering if there was any way to take that data from the one column, and spread it across multiple columns in 24 hour segments.
For example this is my data now:
Time 1st Day views
12:00AM 3
1:00AM 43
2:00AM 0
... ...
11:00PM 5
12:00AM 4
1:00AM 10
2:00AM 0
... ...
11:00PM 15
I want it to look like this:
Time 1st Day views 2nd Day Views
12:00AM 3 4
1:00AM 43 10
2:00AM 0 0
... ... ...
11:00PM 5 15
Any help would be appreciated.
Thanks,

Assuming header is in Row 1, time column is column A, views column is column B, and you know for certain that there is one data entry for each hour -- that is, there are no time gaps in column A --
Enter the formula in cell C2: =OFFSET($B2,24*COLUMNS($B:B),0)
Drag the formula down from cell C2 to cell C25. Then drag the whole highlighted range, c2:c25, to the right until you start seeing zeros. Highlight cell B2 and drag to the right to autofill the header.

Related

Trying to move information to sheet 2 based on a value of a cell from sheet 1

Column1
Column2
00003002300048421607
09 008A00
00003002300048414074
09 013A00
00003002300048415880
30 001A00
00003002300048418713
30 001A00
00003002300048416955
30 002A00
Lets say this table is in sheet1, I am trying to have a formula move a row into sheet 2 (a1 to a1, b1 to b1, etc.) if the 1st 2 digit number is less than 13 (01-12). For example on row 2 since the 1st 2 digit value is 09 I'd like that row moved to sheet 2, and on the other hand row 3 starts with 30 so I'd like nothing to happen there. Please let me know if you need anymore information to assist me, thank you :)

Excel column autofill (autoincrement with formula)

500 employees will have 3 hours of work each day (for sample made weekday image sample). so i tried with auto increment for B2 cell "=sum(A2+3)".
problem arise when i try to enter Absent data or the cell is cleared the data starts from 3 like in E4 or like in E5. need to Enter AA for absent data for that day.
So base the calculation on col A only and multiply the 3 by the column number less 1:
=$A2+(3*(col()-1))
as the column position will multiply by 1, 2 or 3 etc similar to the progression you expected from your method.

excel - drop down list with condition

Maybe the title of the question is wrong, but I'll try to explain what I'm looking for. I have in cell A1 a drop down list to select months (from 1-12). Is it possible to automatically fill the rest of the A column with hourly data for the whole selected month. For example if it's selected "3" in A column'd be:
Time
1.3.2018 1:00:00
1.3.2018 2:00:00
1.3.2018 3:00:00
...
31.3.2018 22:00:00
31.3.2018 23:00:00
1.4.2018 0:00:00
Maybe, something like second drop down list.
Or maybe, it can be done with substitute, but then some months have 31 days, some 30, and february 28, and there is a problem with daylight saving time. In 3rd month, there's one day where I need to have 23 hours (jump from 02:00 to 04:00), and in 10th month one day with 25 hours (02:00, 02:00, 03:00).
In cell A2 enter the following formula:
=DATE(2018,A1,1)
Then custom format the cell with type:
d.m.yyyy hh:mm:ss
In Cell A3 enter the following formula:
=A2+1/24
And change the cell format as above, then drag the cell down to autofill until you have the full month.
There would be multiple ways, but one way is to first determine number of rows required (for March it would be 31 * 24 = 744), set first row using DATE function and then keep adding 1 hour until the desired row number is reached.
Calculate number of rows required in A2: =DAY(EOMONTH(A3,0))*24+ROW()
in A3 enter =DATE(YEAR(TODAY()),A1,1)
in A4 enter =IF(ROW()<=$A$2,A3+1/24,"") and drag down till about 800.
This will make it dynamic for number of days in month

EXCEL Max value for multple time/date intervals

I have an excel file as per the image attached
The date range in column D spans several days ie. there is also data for 10/08/2016; 10/09/2016, ect...
I am trying to get the maximum value in columnC for each 15 minute interval in column D.
eg:
10/08/2016 00:00 - 00:15 -- 0
10/08/2016 00:16 - 00:30 -- 25
10/08/2016 00:31 - 00:45 -- 13
and so forth until the end of the file.
Any help is appreciated.
First you need to get the 15 minute intervals. To do this, I put the Date/Time Start values in column F starting in F2 (I assumed row 1 is a header row). In cell F2 is this formula: =FLOOR(MIN(D:D),15/1440) and in cell F3 and copied down is this formula: =IF(F2="","",IF(F2+TIME(0,15,0)>MAX(D:D),"",F2+TIME(0,15,0)))
Then I put Date/Time End values in column G starting in G2 (because row 1 is a header row). In cell G2 and copied down is this formula: =IF(F2="","",F2+TIME(0,15,0))
Now you can get your maximum per interval. To do this, I put Max Interval Value results in column H starting in H2 using this formula copied down: =IF(F2="","",MAX(INDEX(($D$2:$D$11001>=F2)*($D$2:$D$11001<G2)*$C$2:$C$11001,)))
Adjust columns to suit your needs, and adjust the ranges ($D$2:$D$11001 and $C$2:$C$11001) to suit your actual data.

Frequency of data occurence in Excel Column based on the certain condition

I have a column (Table 1 below) with time data in 24 hour format saved as text.I want Table 2 to be populated by the hour and adding all the occurrences for the hour.
So one occurrence is at 0102. This falls within an hor range of 12:30am to 01:30pm. I want the count to be 1 for 01:00.
If an occurrence falls between 01:30 to 02:30 I want the count to be 1 for 02:00.
Also if time is 04:55 it should show count for 05:00 as 1. Basically rounding to the closest time and showing a count for that. It should round of to the nearest time and add the number of occurrences also. Thats why 06:00 is 2. to account for 0622 and 0614.
For example:
TABLE 1 TABLE2 (Expected results)
Column A Column A Column B
0102 01:00 1
0222 02:00 2
0223 03:00 0
0455 04:00 0
0622 05:00 1
0614 06:00 2
NOTE In B1 we get 1 because value in A1 of TABLE1 is 0102 and falls between 12:30 and 01:30, thus represented by 01:00 in A1 in TABLE 2. We have two values in Table1 between 01:30 and 02:30: one is in A2 and the second is in A3, so we expect 2 in B2 in TABLE 2, the time range which is represented by 02:00 in A2. We attribute 0 to cells B3 and B4 in Table2 because there isn't any data in Table1 between 02:30-03:30 and 03:30-04:30, therefore they get 0 in their corresponding cells in Table2. However, we have two instances of data, 0622 and 0612 in Table1 which fall between 05:30 and 06:30, so value 2 is attributed to B6.
How do I do this using a formula?
Please help.
So after struggling to understand what was going on, here is the simple solution:
first let me clarify again:
column A: but pasted as text originally and in hhmm format, but you need to reformat them as simple numbers, so you will lose those 0 s at the beginning of certain data.
column B: we put down our time ranges, as you said, starting from 12:30 AM, so i put it down as 0030 of which the zeros are not visible anymore in number format. This range starts from 30 and increments by 100, until it stops at 2330 instead of going to 2430. this will be reflected in the formula for the last cell in column D.
column C: the hour ranges against which we round and count the data in A.
column D: we put down the following formula in D2 :
=COUNTIFS(A:A,">"&$B2,A:A,"<"&$B3)
and drag and fill down until the last but one cell.
for the last cell D25 we change the greater/smaller than signs, and use the following formula (only for this cell):
=COUNTIFS(A:A,"<"&$B25,A:A,"<"&$B2)
Try these formulas, if it doesn't work, download the example sheet,
here is the example sheet i created for this purpose, downloadable from here
and if you still have questions, don't hesitate to put them in the commentaries.

Resources