How to have 2 headers (row & column) - excel

I want to create a table where there are 2 axis. It seems I can only create a table where the first row is a header/axis.
My table looks something like this:
1/1/21
2/1/21
3/1/21
10:00:00 AM
Work
Work
Work
11:00:00 AM
Relaxing
Work
Watching TV
12:00:00 AM
Work
Relaxing
Watching TV
13:00:00 AM
Lunch
Lunch
Work
As you can see the time and the date are axis. This way I can create a column graph and see how many hours I spent doing one thing each day. And I can also create another chart and see what thing I do the most during each hour. How am I able to do this?

Records have one "axis" only: Fields.
So, combine date and time into one field, have another field for work type, and then use a crosstab query filtering on a period of dates and grouping on time of the date/time values.

Related

Filtering specific individual dates in PivotTables with changing input

How do I filter data for specific individual dates in a PivotTable? The input is changed on a weekly basis and therefore the specific desired dates will change every week. I have data for every business day. And I want to retrieve data from the most recent business day, 5 business days before that, 30 business days before that and 90 business days before that. How do I go about this?
Sound like you want an 'Aging Report' If you Google on 'Excel Aging Report', you should be able to find something. use of TODAY() in formula is part of answer. I also did something similar here. It didn't involve Pivot tables.. But it should help you on your way.
You might want to check out the code in my answer at Filtering pivot table with vba
That code lets you programatically filter a Pivot RowField or ColumnField by specifying an interval type (e.g. days, weeks, months, quarters, years) as well as an interval count (e.g. 7, -7). It has an optional argument vRelativeTo field which counts back/foward from the youngest/oldest item depending on whether lNumber is positive/negative.
It leverages off the inbuilt DateFilters functionality, and as such does not
work on RowFields.

Can I get the average value for each hour in Excel? Different amount of data for each hour

I have about 160k rows of data which consists of temperatures and flow rates. I need to get it down to being a bit more manageable. I would like to have an average temperature and flow rate each hour instead of several values each minute. I'm not much of a programmer but I don't think this would be a problem if it were the case that I had the same amount of measurements each hour, which is not the case. Each hour has between 200-400 data points and I'm not sure how I would go about this problem. The output I want is something like
date - hr - average1 - average 2 ... and so on.
How the sheet looks
Does anyone have a suggestion of how to go about this?
Sincerely,
This is how it looks in a pivot table. I've put in some dummy data which has two different days and two different times to test it.
To get the date without the time I've used
=floor(B2,1)
because date-times are stored as decimal numbers where the whole number part contains the date and the fraction part contains the time.
To get the hour I've just used
=hour(B2)
My test data looks like this
and the resulting pivot table looks like this
I had to use Value Field Settings and Number Format to tidy up the formatting of the date and average columns.

excel pivot tables grouping dates by their relation to present day

I'm creating a file to track the dates and times of arrival of documents. THe data that I have is fed to the pivot table. The options for grouping data allow me to group them by days, months etc. What I need to achieve is different.
I would like the dates to be grouped as follows (by arrival date):
-today,
- yesterday,
- two days ago,
-more than two days ago.
I tried to create calculated fields but I was unable to write a proper formula.
Is there any way to achieve that?
Thanks.
If the dates are in the column A, I would write sometnihg along the lines of:
=IF(TODAY()-A1=1,"yesterday",IF(TODAY()-A1=2;"two days ago");"more than two days ago")
It is hard to give a definitive answer because you didn't provide any insight into what your data looks like, like a screenshot.

Need to group Time Slots in Excel

I am working on logistics data. I have booking being made throughout the day at regular intervals from start to the end of the day.
Now these booking are consistent and I have time from like
04:45
21:10
21:10
06:07
05:44
05:45
05:45
05:45
etc.
Now as there are multiple bookings I need to group them such as
04:00- 05:00 (1 hours)- this should capture all booking made during this period.
Similar for other hours during the day.
By doing this I will be able to group individual values into specific group. Can you please advice how to achieve the same in excel.
If the values are stored as dates in Excel, the Pivot Table has this functionality built in already with the "Group Field" option. You can group by Hours which is probably what you want. Note that you can select multiple items to get a hierarchy of groups as shown below. This will break if the underlying data is not formatted as a Date so watch out for that.
If you do not have true dates and just have times, you can format as a Time in Excel and it will work. Just don't show the days/date because it will be gibberish.
add a column truncating the time to hours
along the lines of =time(hour(z),0,0)
then create a pivot table using the hour column

frequency distrbution based on 24 hours

I have a power pivot table with a date time entry (which can be changed to any-type of output with a case statement) Format (2012-01-01 00:00:30.000) Which I need to figure out how many of these entry's for any day arrived from 1:00 Am to 1:59 A, and 2:00 am to 2:59 am etc?
How do I format the Bin frequency in excel so I build the hour buckets?
I do want to graph more than one day but that could be done on the SQL side.
You might need to make a new table to chart the frequency distributions. Here's an example.
The formula
=COUNTIFS(A$2:A$17,"<"&F6,A2:A17,">="&E6)
will provide what you want. You can adjust the limits for min/max with the chart shown. Sorry, I couldn't figure out how to easily share the excel file.
As an alternative to the other answer which is valid, you can create a pivot table based off of your data and then group it by right-clicking anywhere in the pivot table, selecting "Group..." and telling it how you want to group the data. You can group by Months, Days, Hours, Minutes, etc...

Resources