I am trying to create a pivot table in excel. I have the following data: person's name and surname, the range of dates during which they were on vacation, the starting date, and the number of vacation days. I would like to create a summary where I would have months in rows and then people. In the column headers, I would like to have days - from 1 to 31. In the appropriate places, I would like to have marked days worked. Example: Julia X was on vacation from 01.01.2022 to 05.01.2022. I would like the columns with values 01,02,03,04,05 to have marks. How can I do this?
I have created an additional table where I have values of days from 1 to 31. I also have all the dates in the year from 01.01.2022 to 31.12.2022, and each date also has the given week. I tried to merge them, but I am failing.
enter image description here
Related
i was wondering if someone can help. i have tried some formulas but cant seem to work this out. i have a list of data with lots of dates some duplicate dates which are fine. i have data on a daily basis from 2015-2018. my aim is to try to put a number against each week between 2 dates so Monday-Sunday representing a week. so if the date falls between to dates bring back the week number. but of course there is a long list of date ranges and week ranges. does anyone know a formula or code to read to date and look between 2 separate dates and bring back a week number
thanks
Muj
For a given date, weeknum() will return the week number:
I am working to group data in excel and I am trying to sort the input dates by month and week. I've found a number of ways to group by weeks (including grouping the date by 7 days and adding a helper column in the pivot table that numbers the weeks), but I'm having a problem viewing months and weeks without data.
For example, in my data set during the month of October, 2 of the weeks have no input. When I try to make the pivot table "show rows with no data" it shows every week in the year, not only the weeks during the month of October.
I would like be able to show every week during the month of October, including those without data, without showing every week in the year. Has anyone encountered a similar issue? I'm on Excel 2016 but my colleague has the same issue on Excel 2013.
Thanks!
Here is a quick screenshot of the pivot table from the data. I am trying to make all of the weeks in the month of October show up regardless of whether or not there is data, but I don't want to see all of the weeks in the date range. I have sample data input from September 16th, 2018 to January 1st, 2019
Update for anyone looking to do this themselves:
I couldn't figure out a way to do this with Pivot Charts. They lack the ability to group by multiple days as well as by months and years. Instead, I used VBA to select the desired data from the pivot table by checking for the number of the month in each row. (mm/dd/yyyy - mm/dd/yyyy is the format pivot tables use to group days).
I added a dummy row which copied the date ("Date 2") and used that, grouped in 7 days, as the rows for the pivot table. Because I wanted to show items with 0 data I selected that option, which shows every group of 7 days from the first day entered until the last day entered. I used the original Date with Month and Year auto groups to insert Slicers to sort the data.
In VBA you can check which Slicers are selected and use that to determine the range of months you want to display on the inserted chart. This way you can look at one or two months at a time but still show weeks with no data.
While this solution is not particularly elegant, it did allow for a dynamic use of the data that can be adjusted to view specific months or years as was desired. Some useful resources for this method are included below. Again, it is an ugly way to get the desired result but if it works it works!
https://peltiertech.com/referencing-pivot-table-ranges-in-vba/
https://peltiertech.com/create-update-chart-using-partial-pivot-table/
I have tried multiple ways to create this graph but I can not. If I place the data into a pivot table, it will not allow me to create the graph (error message is that I can not create a graph from a scatter chart). I am placing it in a pivot table to group the data for both columns to help organize the chart (the dates are formatted 1/1/2015 so I am trying to group all dates into months).
Here is what I am trying to do:
I have two columns. Column A and Column B.
Column A / 319 rows - Data consists of dates ranging from every month in the year 2015
Column B / 109 rows - Data consists of dates ranging from every month in the year 2016
I am trying to create a line graph that shows the following:
Two lines, one representing 2015 and one 2016.
The x-axis should display the months throughout a year.
The y-axis should display numbers (representing # of times data shows up in that month).
Am I using a wrong chart? Am I not setting up my data correctly?
Currently, in row A1 and B1 are the years, so 2015 in A1 and 2016 in B1. Every row below that has random dates.
Basically each of these dates represents a open ticket so I am trying to find out how many tickets were opened in each month.
Photos due to request:
I can get a single line, but not with two sets of data.
two sets of data:
Moving dates into one column, still one line:
#SeanC - The data is not accurate. Also, there are no dates for 2016 from July-Dec. Also, it shows 2 dates for June 2016 but there are more. 2015 looks more accurate but not 2016.
#SeanC - Removed the 2016 total, same issue
Adding more evidence here (Lastest Date in Column B is June 28 and it also has 13 dates June - If you notice, the pivot table shows 2 dates for June and also dates for months that don't even exist in Column B):
You are close. What you may not realize is that Excel will accept the same field in value and in a row/column/filter
Put column A in Row Labels, then put columns A and B in Values.
Group column A by months (leave out the years) and you will end up with the counts you require.
Looks like I almost found my answer by placing the year value to the legend.
The blue line is accurate but not the red.
I Think in your latest screen-shot you plotted the Grand Total series instead of 2016 (or there is some mix-up in the Data).
Please see attached screen-shot of the table and chart I got when putting all the dates in a single column (I only typed in a part of your data, just to check it's running OK)
Excuse my chart, going right-to-left, some Hebrew settings my wife did on the PC at home :)
Hopeful you can help me out.
I have an Excel spreadsheet open. The spreadsheet has two columns that I need assistance with.
The first column are dates and times that reflect a ticket that opened. The second column reflects dates and times that a ticket closed.
I am needing to correlate all the dates of which every ticket opened and closed to its respective week of the month. So if I have 20 tickets that opened up between the days of 2/22/15 - 2/28/15(all these dates are in the same column fyi...), then I will be needing to somehow correlate these tickets in my spreadsheet to some form of data to be used in a line stack chart.
An exec has laid this on my lap. I don't look useless and I would like a little assistance as to how to perform such a task. Formulas in Excel...Vlookup....or using Pivot Tables....please assist!
convert date in excel to its respective week of the month
in conjunction with the date range example:
=INT((DAY(A1)-1)/7)+1
In column 3 use the =Weeknum(A1, 1) formula to get the week number of the date in column a. The second argument lets you determine what you want for the beginning of the week to be.
In column 4 do the same for column b. This will give you the week ticket opened/closed respectively. Add column 5 to be the difference in weeks which can be used in a pivot table to show the distribution of tickets and weeks to resolve, etc.
Reply back if you have further needs.
Firstly get the week num of the first day of the month -1
A1 = 01/02/2018
B1 = =WEEKNUM(A1)-1
Then calculate the individiual ticket week numbers and take the week number before the first week of the month away from the returned value. You may need to format the cells as numbers as some reason Excel thinks its a date
Open Week = =WEEKNUM(OpenDateCell)-$B$1
Close Week = =WEEKNUM(CloseDateCell)-$B$1
Representative Image:
I encountered a practical problem that can be simplified as follows:
My excel sheet has a single column which is the date I had a beer can. It can repeat based on the number of beers cans I had a day. (eg. I had three beers on 5/9/2012) I need to generate the trend of my beer consumption per week. How can I do it in excel?
**Date of beer**
5/9/2012
5/9/2012
5/9/2012
5/12/2012
...
7/3/2012
You could make a pivot table. Date as a row field, Count of Date (i.e., count of beers) as a data field. Group the row field Date by 7 days to get weekly totals.
You'd probably be better off with a two column spreadsheet. Column A = Date; Column B = Number of cans. Then you could easily just make a line graph from that.
If you already have a large amount of data in your format you can use excel's subtotal function to create the two column format for you.
First i would put a formula in to get a week number for each date, and then use a count if for each week of the year.
This formula will assign each day of the year the week number of the year it falls in. Put this in each cell next to your dates.
=IFERROR(1+INT((AF12-DATE(YEAR(AF12+4-WEEKDAY(AF12+6)),1,5)+WEEKDAY(DATE(YEAR(AF12+4-WEEKDAY(AF12+6)),1,3)))/7),0)
Once that is done create a column of numbers 1-52 (53 for leap year) and do
=countif(rangeofcalcdweeknumbers,week1to52)
and copy that down for all 52 or 53 weeks
Then make a graph based on the final two columns