display/merge multiple columns in a table as one column just separated by lines - excel

Is there a way to display/merge multiple columns in a table as one column just separated by lines. More specifically, what I want is to display value for rows for different days of the week, and there are multiple such weeks in a year.
Thus, for example, an engineer works on the week on 4th jan '16 from monday to sunday for some number of hours each day, then next week of Jnauary he works some different hours each day.
Thus, every week from Mon to Sun will have a different value for each day. I want to display these weekdays as a cluster so I see them together and not separate columns for every day.
I have attached a sample sheet.
Sample Image

Related

How do I get the average number of occurrences of a date for each day of the week in excel?

Let's say I have an excel spreadsheet recording some event that reoccurs often multiple times a day, sometimes not at all in a day. So I record the date and a bunch of other information for the event every time it happens. What I'm trying to find is, the average number of times this event occurs on each day of the week.
list of dates
So I want it to look at each day of the week, and find the average number of dates matching each day of the week, starting at the first date and ending at the last date. It should also take into account missing dates, so if there's a Friday with no records, that should affect the average occurrences for Friday.
I've tried using a Pivot Table to find this, and it can get me most of the way there, but it doesn't know to include missing dates within the "count of date" column.
pivot table
I'm not trying to find the average of some other value per day of the week, just the average occurrences of a date per the day of the week. Is this something that is possible in excel, or will I need to use scripts?
For an example where there's multiple weeks of data, I would expect to get a table of results like this:
Day of the week
Average
Mon
2.50
Tue
2.00
Wed
2.50
Thu
2.50
Fri
1.00
Sat
2.50
Sun
2.50
With Friday being lower as there is no Friday date in the provided range (the first Friday has 2 records, and the second Friday has 0 records).
We would need more data to really verify it (try it and let me know). You can use the following formula in cell D1:
=LET(A, A1:A14, B, B1:B14, wdays, TEXT(SEQUENCE(7), "ddd"),
cnts, COUNTIFS(B, wdays, A, TOROW(UNIQUE(A))),
ones, SEQUENCE(COLUMNS(cnts),,1,0), totals, MMULT(N(cnts>0), ones),
sum, MMULT(cnts, ones), HSTACK(wdays, IFERROR(sum/totals,"")))
Or you can use a more succinct formula via BYROW as follows:
=LET(A, A1:A14, B, B1:B14, wdays, TEXT(SEQUENCE(7), "ddd"),
cnts, COUNTIFS(B, wdays, A, TOROW(UNIQUE(A))),
HSTACK(wdays, BYROW(cnts, LAMBDA(x, IFERROR(AVERAGE(IF(x=0,"", x)),"")))))
Here is the output:
Note: If you want the result presented starting from Monday, then define wdays as follow: TEXT(SEQUENCE(7,,2),"ddd").
The name cnts, has the counts per week days (rows) and per columns (unique dates from column A). The rest is just to do the match to calculate the average. We ignore dates with no counts for calculating the average, as per my understanding of the sample input data from the question.

Power BI: How to Group by 7 Days Bin for Bar Chart to start from Monday instead of Sunday?

I'm trying to create a barchart showing counts of events with Month View drilling down to Week and to days. I have created new groups, such as column "Month" by grouping 1 month in a bin and column "Week" by group 7 days in a bin. I noticed that when I drill down to week, it always starts on a Sunday. My client wanted to be on Monday. I've tried adding a new column "Week2" with "WeeK" dates + 1. The time axis does shows the date shifted by 1 but the data under that week still starts on Sunday. Attached is a screenshot of my barchart with group by week on Date.
Is it possible to change the Weekly Bar chart to start on Monday instead of Sunday for the drill down?
I can see two possible solution to your problem:
You could quickly create a small table to link to the day of the week you currently have on your table. Then on this table which would have the seven vaules for each day of the week you add a column with your prefered ordering (such as monday first) and then use the "Sort by column" option on the column tools in the top ribbon.
You could use a time dimension table, such as the one found here, you can specify in the script when the week starts, and you can remove all the columns you won't use.
I can't test your exact scenario at the moment, I hope one of these solution may work for you

Make values zero for specific days in a week and add them evenly across other days for same week

I have this sample dataset. I am trying to figure out a formula in Excel to make the values for Saturday and Sunday zero for each week then take the sum of these two days and add it evenly across the remaining five days of the same week.
For e.g. in the table in image attached below for week 19, Sun = 1 and Sat = 7. In the output, I want the values for Sun and Sat to be changed to zero but the sum Sun = 1 and Sat=7 which is 8 needs to be divided equally among the remaining five days 8/5 = 1.6 and then added to the remaining days for the same week. I need to do this for every week.
Output Sample
I have tried using a formula like this but not sure what to do next:
=IF(OR(B3="Sat",B3="Sun"),0,D3+((VLOOKUP(CONCAT(C3,B3),$E$2:$G$15,2,FALSE))/2))
First test if Sun or Sat. Then use SUMIFS to return the value for those two days and divide by 5 and add it to the value:
=IF(OR(A2={"Sun","Sat"}),0,SUMPRODUCT(SUMIFS(C:C,B:B,B2,A:A,{"Sun","Sat"}))/5+C2)
Or if one has Office 365 and wants a spillable formula:
=LET(
dy,A2:A15,
wk,B2:B15,
sl,C2:C15,
wkend,(dy="Sun")+(dy="Sat"),
IF(wkend,0,SUMPRODUCT(SUMIFS(C:C,B:B,wk,A:A,{"Sun";"Sat"}))/5+sl)
)

How to count entries on monthly basis? Such that same row/entry can be counted in multiple months if conditions are met

I am trying to make a bar chart with X- axis showing timeline with respect to months (Jan, Feb, March etc). On Y-axis, I want to count how many [KRI] are there in each month based on their [Status Category]?
I have two conditions though:
1) If [Status Category] is 'Final', count that KRI in all months between [TRIGGERDATE] month and [statchedate]. for example, same KRI should be counted in Jan, and Feb and March etc (from time it was open till the time/month it was closed).
2) If [Status Category] is NOT Final, count that KRI in all months between [TRIGGERDATE] month and today's month.
In the picture below with the data sample, the pink colored blocks shows when the KRI should NOT be counted in that particular month.
I am trying to write a custom expression using if statement, but I am not able to figure out how would spotfire know that a KRI should be counted between [Triggerdate] and [Statchedate]? Or for instance, between [Triggerdate] and [today]
I am also thinking about adding a calculated column that will determine if the KRI should be counted in how many months? (but this will be ongoing data, so I am afraid that my column would keep on expanding..)
Any suggestions would be very much appreciated :)

How to show a customer's order frequency over specific bands of time.

I have a list of E-mail addresses and order dates. I am trying to figure out how to display the number of customers that order every week, twice a month, once a month, once every 2 months, once every 3 months, once every 4 months, and once every 5 months or more.
What is the best way to accomplish this is? I have 400K records.
I'd suggest a pivot table that counts dates by e-address. With say 12 months of data Count of date = 6 is once every 2 months (on average!) =12 is once every month. That does not deal with an e-address that ordered 4 times in the last month of the year but I am not sure that is your requirement because if ordered on the last day of the year the frequency could be any of your options.

Resources