Bringing conditional formatting to the front of a collapsed group - excel

I'm creating a Gantt Chart that covers every day of the year, I also want the days to be grouped into weeks to be able to see the year as a whole easier. I've used conditional formatting to show tasks durations, tasks being overdue etc, and a vertical column to show the current date. These are shown in the image below.
Expanded groups
This all seems to work well but my problem is when I collapse a group I lose that information, as seen in the next image.
Collapsed groups
How do I retain the information on the collapsed group, showing the highest priority conditional format within that week group as the front "label" of the group?
Thanks :)
I've tried playing around with the conditional formatting but I've not been able to achieve the results I wanted. I think the results might lie in VBA?

Related

Obtain earliest date from a table according to summary value

I have a table as follows, which has a category and some dates
I want to get (i) the earliest date for each category and (ii) the latest date from the category. Basically Im trying to get a Gantt chart visual between the two dates, based on the name
For example, alpha would run from 3May22 to 3 Aug22 on the chart since that effectively the start and end date of the category
I tried to drag my columns into the Gantt chart but I end up with a bunch of rows for each task (e.g. alpha, alpha, alpha) while I want to have the start date from the earliest alpha and the end date from the oldest alpha in one line.
Not sure if I need a measure (I think so) or a new column but I'm a bit stuck
Any help would be appreciated :)
Thanks,
Matthew
Actually, I found it, hopefully of use to someone else in the same boat.
PowerBI allows you to group the categories together under the visuals edit tab
I clicked that and suddenly everything looked good!

Summing up cohort behavior cumulatively by date ranges without offsets in excel

I think this problem, when solved by creating additional charts with offsets, is easy. I want to cut out the middle man and not use offsets (unless they are useful to the answer). I have data for daily cohorts and I know specific information about their behavior 1 day later, 2 days, 3 days ect.
Now it is rather easy to make a waterfall chart of day by day activity like so...
What I want to do is skip this step (directly above, the waterfall chart) in hopes of shrinking my current workbook by a substantial amount. You can imagine having simply 1 year of data across multiple channels measuring even 1 aspect of behaviors can account for a lot of data and pivot charts. Also, btw, I have the top chart as a pivot thus allowing this to be hands off when calculating what I am looking for.
What I seek - I look to further construct groups of days as other cohorts to examine (for example, say, 1/1 - 1/5) and see what their activity has been in a cumulative fashion since then. To be more specific, I want a table that will show cohort 1/1-1/5's activity in the date range 1/1-1/5 (11) and then their activity from 1/1-1/9 (24, an additional 13 "behavior points" summed).
So far, as I said, my current solution involves the "blue arrow" schematic where an additional table is constructed and I can sum on, essentially, rectangles build by using OFFSET on sell ranges with the MATCH function. I am stumped with how to go about this without the additional charts.
Thanks!
VBA would better for this, but use this formula in C30:
=IFERROR(SUM(SUMIF(OFFSET(OFFSET($B$1,$A30-MIN($B$2:$B$10),MIN($B$2:$B$10)-$A30+DAY(C$28)),SEQUENCE($B30-$A30+1),IF(COLUMN(OFFSET($B$1,$A30-MIN($B$2:$B$10),MIN($B$2:$B$10)-$A30+DAY(C$28)))-SEQUENCE($B30-$A30+1,,0)>COLUMN($B$1),0-SEQUENCE($B30-$A30+1,,0),COLUMN($B$1)-COLUMN(OFFSET($B$1,$A30-MIN($B$2:$B$10),MIN($B$2:$B$10)-$A30+DAY(C$28)))+1),1,IF(COLUMN(OFFSET($B$1,$A30-MIN($B$2:$B$10),MIN($B$2:$B$10)-$A30+DAY(C$28)))-SEQUENCE($B30-$A30+1,,0)<=COLUMN($B$1),(C$29-C$28+1)-SEQUENCE($B30-$A30+1,,-(COLUMN(OFFSET($B$1,$A30-MIN($B$2:$B$10),MIN($B$2:$B$10)-$A30+DAY(C$28)))-COLUMN($B$1)-1)),C$29-C$28+1)),"<>")),0)
and this in D30:
=C30+SUM(SUMIF(OFFSET(OFFSET($B$1,$A30-MIN($B$2:$B$10),MIN($B$2:$B$10)-$A30+DAY(D$28)),SEQUENCE($B30-$A30+1),IF(COLUMN(OFFSET($B$1,$A30-MIN($B$2:$B$10),MIN($B$2:$B$10)-$A30+DAY(D$28)))-SEQUENCE($B30-$A30+1,,0)>COLUMN($B$1),0-SEQUENCE($B30-$A30+1,,0),COLUMN($B$1)-COLUMN(OFFSET($B$1,$A30-MIN($B$2:$B$10),MIN($B$2:$B$10)-$A30+DAY(D$28)))+1),1,IF(COLUMN(OFFSET($B$1,$A30-MIN($B$2:$B$10),MIN($B$2:$B$10)-$A30+DAY(D$28)))-SEQUENCE($B30-$A30+1,,0)<=COLUMN($B$1),(D$29-D$28+1)-SEQUENCE($B30-$A30+1,,-(COLUMN(OFFSET($B$1,$A30-MIN($B$2:$B$10),MIN($B$2:$B$10)-$A30+DAY(D$28)))-COLUMN($B$1)-1)),D$29-D$28+1)),"<>"))
And copy both down.
If one does not have the dynamic Array formula SEQUENCE() then replace all the SEQUENCE($B30-$A30+1) and SEQUENCE($B30-$A30+1,,0) with ROW($ZZ$1:INDEX($ZZ:$ZZ,$B30-$A30+1)) and (ROW($ZZ$1:INDEX($ZZ:$ZZ,$B30-$A30+1))-1) Respectively, and use Ctrl-Shift-Enter instead of Enter when exiting edit mode.
I was able to collaborate on a solution. I am told that it will be highly inefficient at scale but it gets the job done. It ss less automation-friendly but can be formulated to capture data not currently present on a, say, a pivot table that you call to update later by extending the area that the formula works on.
Formula in in I31:
=SUM(IF(($C$1:$O$1+OFFSET($B$2,$G31-$B$2,0):OFFSET($B$2,$H31-$B$2,0))>=I$29,OFFSET($C$2,$G31-$B$2,0):OFFSET($O$2,$H31-$B$2,0)))-SUM(IF(($C$1:$O$1+OFFSET($B$2,$G31-$B$2,0):OFFSET($B$2,$H31-$B$2,0))>I$30,OFFSET($C$2,$G31-$B$2,0):OFFSET($O$2,$H31-$B$2,0)))

Group values into an "others bucket"

I have a list (30+) of users with the number of times those users were active per month in my system. I'm using an Excel chart to show which users have been consistently active over time. About one third of the users come consistently (several times a month) while others come one month and not another.
Unfortunately since I have 30+ users, the colors in the Excel chart are difficult to distinguish from one another. What I was thinking to remedy this was to only show the top 10 (or 15) users and group the others into an "others" or "catch-all" bucket and still shows it in the chart.
A sample image of the chart:
What's the best way to do this?
Add a column that differentiates 'Active' from 'Non-active'. In the sample I had to create overall B and C were the most active so I populated D2 down with:
=IF(OR(B2="B",B2="C"),"Active","Non-active")
Adjust the formula if that distinction is made on a month by month basis. Create a Stacked Column PivotChart and in the PivotTable move the 'Active' together as necessary. Select each of the Non-active series (here only two for illustration) in the chart and apply the same colour fill to all.

Can I display daily data in month buckets using only excel's chart formatting?

I have daily sales figures that I'd like to plot on a simple linegraph.
I would like them to be shown in monthly buckets (i.e. if I sold 5€ on Jan 01 and 10€ on Jan 24, I would like to see only one data point for January with 15€ in it).
Please note that I don't want to use any supporting formula/VBA script, I want to do this using only chart formatting.
I tried setting the chart's X-axis type to "date axis" and I chose "months" as the base unit.
This almost works, but the line graph ends up being kind of weird. Changing the chart type to histogram doesn't help much either. The individual sales are not "piled up" like I would but, instead, they're hidden one behind the other. Stacked histogram doesn't work either.
Any clue on how I can force excel to bucketize my data using only chart formatting? This can't be that hard...
Try creating a pivot chart, then grouping the dates by month (right-click a date in the pivot table, and click "Group by... Month".
If you want to group by Years as well - hold down the Ctrl Key whilst you select the Month (both categories will then show up)

Draw an Excel Line Chart of my account balance

I made a table with my earnings and cash disbursements. And I list the account balance.
Now I want to draw the account balance in a line chart. But the problem is that there isn't a value on every day. So the line between to entries is different because different time lies between two entries. Sometimes three days, sometimes 22 days, ...
How can I realize, that the line is constant after a value and the line only change on a day, with a new value?
Edit (from comment): I'm using Excel 2007
Like the others have said, to get the true time difference between your points to show up, you have to use a scatter plot instead of the Excel line graph.
To display the true state of your balance at in-between dates (i.e., no sloping lines), you'll need to do some transformation of your data. It amounts to creating two new columns of data with duplicate points for each balance: one at the date the account balance reached that level, and one at the date the balance left that level.
I suggest the following:
To populate your Balance column, in the first cell (I'm starting my table at E2) enter
=B2
where B2 is the address of the first balance in your original table. In the next cell down enter
=IF(E2<>E1,E2,OFFSET(B$2,COUNT(E$2:E2)/2,0))
Fill down this formula as far as you need to.
Then in the first cell of the Date column of your new table (I'm starting at D2) enter
=A2
where A2 is the first date in your original table. In the next cell down enter
=IF(E3=E2,OFFSET(A$2,COUNT(E$2:E3)/2,0),D2)
Fill down this formula. Then use this new table as your source data for the scatter plot. Here's a screen capture of a sample:
Are you using an XY-Scatter Plot. A line chart adds in the missing days automatically. Make sure your x-axis is formatted as date.
If you insist on using XY-Scatter Plot then you can put in days for each day, if that day doesn't have data then for the y-axis put in =NA().
I think the chart you need is a step line chart based on your description. The answer of #Excelll above has already pointed out a way to do this in Excel. But here I've another solution that could avoid manually adding some rows to your data. You could use the Funfun Excel add-in to create step line chart. Here is an example that I draw.
As you could see there is some code in the Excel. The Funfun Excel add-in allows you to use JavaScript code directly in Excel so that you could use powerful libraries like HighCharts.js or D3.js to draw charts that could be difficult in Excel alone. In this example, I used HighCharts.js. And it's quite easy to plot this chart since HighCharts.js iteself supports step line chart, so all you need to do is add the step option in your code like the code below.
series: [{
name: "Balance",
data: balance,
step: true,
showInLegend: false
}]
Another advantage of the chart that I showed you comparing to other solution is that you get real time interval in your x-axis. As you mentioned, you may not take record of your balance everyday, the x-axis in the example above shows irregular time interval.
The Funfun also has an online editor in which you could explore your JavaScript code and result. You could check the detail of how I made the example chart in the link below.
https://www.funfun.io/1/#/edit/5a4e478f1010eb73fe125cb2
Once you are satisfied with the result you achieved in the online editor, you could easily load the result into your Excel using the URL above. But of course, first you need to add the Funfun add-in into your Excel by Insert - Office Add-ins. Here are some screenshots showing how you load the example into you Excel.
Disclosure: I'm a developer of Funfun
Excel is really rubbish at charting this kind of thing. In my experience, the best way to chart it is to start with an X-Y plot rather than a line graph, and select the option where it joins the points with a line.
You may also need to add a new column showing "days since start", and use that as the X axis instead of the date - I can't remember whether Excel 2007 can deal with dates properly or not. Try it and see.
Finally, if you include any cells in your chart that are not yet populated (eg because you want to make the chart from the whole column even though you only have a few entries so far), you need to have the empty cells populated with "#N/A" otherwise it will plot them as 0.

Resources