Excel create chart from date, hh, mm, ss columns - excel

I have a csv file with the date and time (h,m,s) all split in separate columns. I would need to display the count in a chart with the appropriate date/time value. I really can't figure out how
screenshot

Remove blank rows or rows without dates, then create a pivot table. Drag date into the rows area, then hours below date, then minutes below hours, if that level of detail is desired.
Drag any field into the Values panel and set it to count. Create a chart from that.
If that does not do what you want, you need to edit your question with A LOT more detail to describe the desired output.
Edit: Another approach: construct a complete date/time value with a formula
=B1+time(0,0,C1)
(assuming that column C has time values in seconds.) Now create a pivot table with the new columns in rows and a count of CT in the Values. Build a chart from that.
If you need the X axis to be a time axis, you need to build a regular chart from the pivot table, not a pivot chart.

Related

How can I get my Excel spill range to be grouped by a specific column for a chart?

I need to produce a chart in Excel to show a quantity of items for a number of categories, grouped by the month they were received. At the moment, every occurrence of the Month shows up in my clustered column chart. I can manually do a table and remove all except the first occurrence of each month, but I need it to be done dynamically as the date range can be changed (between 1 and 12 months). I have a full list of data for 12 months, showing Types and their Quantity received. I've filtered the list to just show the types and quantities received between the date range selected (picture 1).
The three images below show the spilled data, the current chart, and how I would like the chart to look. If it cannot be achieved directly using a spill range, then could anyone suggest another approach to have my data dynamically displayed in a chart, grouped by month?
Not a perfect answer but here's a start:
You could paste:
=IF(COUNTIF(F$5:F5,F5)=1, F5,"")
in J5, and drag this down a sufficient way to cover the expected length of the dynamic array.
Then paste:
=CHOOSECOLS(F5#,2,3)
in K5, and use these three columns for your graph data.
I can't think of a way to make the "J" column dynamic at the moment.
EDIT:
Pasting:
=XLOOKUP(ROW(F5#), XMATCH(UNIQUE(CHOOSECOLS(F5#,1)),CHOOSECOLS(F5#,1))+4, UNIQUE(CHOOSECOLS(F5#,1)),"")
in J5 should work dynamically too.

Excel: graphing a 3 colums table (column label, column date, column position)

I have a set of 3 columns:
keyword (consider it as a kind of tag; there are only 5 distinct)
dates (today, yesterday, ... 30 days ago)
a value for each combination of keyword and date
I can easily plot one Line Graph (see the picture below), but I need to plot all the lines. I'd like Excel to understand that each different Keyword is a different series.
Is this a pivot table or just a table?
If it's a table create a pivot table with the keywords in the Legend series on the top, the dates in the Axis (category) box on the bottom left side and the values in the Values area.
Create a line chart and there you go.
You need to use the pivot table to gather the data in series. You have to present the data in a way that will work for your chart. A flat table is not going to give you what you want.

Pivot table to plot sums of dates of each month

In excel I have a column of days (mm/dd/yyyy) and I want to have a timeline sort of plot showing how many points I have for each month of each year. It's easy to show how many instances a day appears with a pivot table (added a column "Count" with just 1's), and then make a plot for that, but I don't know how to do that with just the month/year.
I tried using the =month and =year functions, and highlighted those columns (with the "Count" column) to make a pivot table, but I'm not sure how to group and plot it the way I want. Here's what it looks like when I have data point sums for month/day/year, I want the same thing but with the month/year:
And here's my data:
I'm sorry if this is a really low level problem, I'm a noob at pivot tables and have been trying this all day
You can group the data by month (or other useful options like quarter & year) IF values are formatted as actual dates. It looks like yours is formatted as a date but just in case, here are two ways to test...
A) Change format of a cell with date to number (this should return a date serial)
B) Use =ISTEXT(Select Cell With Date) (this should return FALSE)
Once valid date format has been verified
Click on a date in pivot table
Navigate to Analyze tab
Select Group Selection
You should get a pop-up asking how you want to group the data. Select Month
Ensure you are summarizing the points by Sum (right click on point cell in pivot and set option at Summarize Values By)
If you are using a pivot chart, it will update on refresh to reflect new row groupings (I.E. show monthly sums as you asked for)
Before & After photos below

Offset function for dynamic range not ignoring cells with #N/A in Line Chart

I am facing an issue with excel offset function for a range which increases horizontally and vertically.
I have a pivot table built from raw data which keeps on updating. I am mainly concerned with products and corresponding price per quarter in the pivot.
I have created another sheet pulling the products from the pivot and corresponding blended price (calculated based on pivot values - Sales/Units).
Below is the code:
Formula to pull the products from the pivot:
IFERROR(INDEX($A$10:$A$155, AGGREGATE(15,3,ROW($A$10:$A$155)-ROW($A$9)/($A$10:$A$155<>""),ROWS($A$10:A10))),#N/A)
Formula to display the corresponding blended price for the product:
IFERROR(INDEX(AZ$10:AZ$155, MATCH($CC10,$A$10:$A$155,0)),#N/A)
Now I need to create a line chart for the above data. Below is the code for Name Manager:
Quarters=OFFSET('Blended Price Calculation'!$CD$9,0,0,1,COUNTA('Blended Price Calculation'!$CC$9:$DA$9)-1)
0.45_Saline=OFFSET('Blended Price Calculation'!$CD$10,0,0,1,COUNTA('Blended Price Calculation'!$CC$10:$DA$10)-1)
0.9_Saline=OFFSET('Blended Price Calculation'!$CD$11,0,0,1,COUNTA('Blended Price Calculation'!$CC$11:$DA$11)-1)
10_Dextrose=OFFSET('Blended Price Calculation'!$CD$12,0,0,1,COUNTA('Blended Price Calculation'!$CC$12:$DA$12)-1)
Similarly for the rest of the products
I want to the horizontal axis to be Quarters and not Products.
Dashboard - Filter based on Slicer
Original Excel without filter
Excel when Slicer filter is applied (to display only 2 products)
Problem:
The chart displays #N/A when I filter data using Slicer in the dashboard. Slicer is acting on pivot table. Basically I need help on offset function which will pick only those values which has data for both rows and columns. Currently I have the formula working for Columns but it is not working for rows, hence the line chart is considering all the rows. But since I have selected only a couple of products (using slicer) out of 100 odd products, line chart shows graph perfectly for those selected products and shows #N/A for the rest.
How can I not display #N/A in my chart legend? I think having a combination of vertical and horizontal offset function should solve my problem but I am struggling to find the solution.
Any help is really appreciated! Thank you!
The issue here is that you have hard-wired ten series into the chart. You can use range names to dynamically change the number of data points in a series, but you can't use a formula approach to dynamically change the number of series in a regular Excel chart. That will require VBA.
If you use a pivot chart instead, you can select the series with a slicer and the legend will show only the visible series.
Edit: Here is a screenshot to illustrate how a pivot chart can be filtered and unused series will not show in the legend.

Excel: transpose rows to columns and merge

I would like to present some data in Excel in a table. I have a sheet with three columns: date, time_spent and user_id. Every row is a data record. I want a table with a column for every date and every value with time spent below the date.
Using the transpose function under paste special I get this:
However I would like only one column per unique date, so the amount of columns decrease like this:
Does someone know how to do this?\
I have more than 10000 rows, so manually is too much effort...
Using Pivot Tables as Tim Biegeleisen suggested I cannot get what I want either, I'm not an expierenced user of Pivot Tables so probably I'm doing something wrong:
Excel file as shown in above picture
Here is one way of using a Pivot Table as suggested by Tim above in the comments, but you must use it on your original, non-transposed data: (and note which parameters go to which areas.
A disadvantage of the Pivot table is that the column headers are text strings and not dates. If your version of Excel is 2010+, you can use Power Pivot or Get and Transform to do a better job:
Open the Query Editor, change the format of the Date column, and Pivot the column:
Then Save the results:
Advanced filter dates to unique values in a new column
Copy and transpose them to make your column titles
Insert a new column B with the formula =TEXT(A2,"yyyyddmmm")&COUNTIF($A$2:A2,A2) and fill down
Below your new column headers put in the formula =IFERROR(VLOOKUP(TEXT(H$1,"yyyyddmmm")&ROW()-1,$B$2:$C$8,2,FALSE),"") and fill down and across. You will need to fill it down to cover the maximum number of instances of each date.
Adding a sumif to this table and your initial table would be a good way to check you got everything.

Resources