Google Sheets: How to make a stacked/aggregate chart - google-sheets

I have made a bar chart which aggregates my data, but is there any way I can split each bar based on the data it is aggregating - similar to how a stacked bar chart would look?
Here is a bad artists impression (thick blue lines mine). The idea is that it's important to know from looking at the graph if I sold 5 at £1, or 1 at £5.
Ideally this would work even if the price for each item is variable, but that is not essential (eg: if there is a 'hack' with hardcoding Apple = 3, I can live with that.)
I'm also fine inputting helper columns etc, within reason, but I would want to be able to easily continue to add things to the list on the left without having to add new helper columns each time (calculated ones are fine, of course.)
Thanks in advance.
UPDATE: With thanks to Kin Siang below, I ended up implementing a slightly modified version of their solution, which I am posting here for completeness.
I added a very large (but finite) number of helper columns to the right, with a formula in each cell which would look for the nth occurrence of the item in the main list (wrapped in an iferror to make the unused cells blank).
=iferror(index(FILTER($A:$B,$A:$A=$D2),E$1,2))
Theoretically it could run out of space one day, but I have made it suitably large that this should not be an issue. It has the advantage over the other solution that I do not need to sort or otherwise manipulate the input range and can continue trickling in data to the main list and have the chart automatically update.

Yes, it is possible to display the chart in your case, however need some data transpose in order to do so, let me show you the example with dataset
Assuming this is your original data:
First sort the data by alphabet, and enter this formula in new column
=if(G39="",1,if(G40=G39,I39+1,if(G40<>G39,1)))
Next add new column for categorical purpose, by using concatenate function
="Price"&I40
In the transform data for chart purpose, enter this formula to split all price into different row, different column for different product
=sumifs($H$40:$H$47,$G$40:$G$47,$A41,$J$40:$J$47,B$40)
After that i select stack bar chart and ensure the price in under series, in case in 23 will have some problem to set price at series correctly, you can use 33 data create stack bar chart and update the data range again, it will work also
Here is the cute chart you expected, accept if help :)
*When certain fruit has less price record, it is advised to fill in 0, as the data table need in same column (see the orange price 3), although I didnot test if blank

Related

I'm looking for a Google Sheet array function to add specific increments in each row

Here's how it looks.
Hi. I'll try to be as specific as possible about this :)
I'm making a Google Sheet page similarly to a game character progression, that will automatically fill up based on data from other sheets: specifically, these "EXP" bars fill up with values based on the hidden cell A5.
For instance, the cells from D5 to BA5 represent LV1.
As the function shows, every time the value in A5 reaches an even number (for LV1, it's all even numbers from 2 to 100), one of the slots will fill up with a number, that with conditional formatting, will change the color of the cell and make it look like an actual exp bar filling up.
I'm using the function =COUNTIF(A5,">=2") and manually changing it to ">=4", ">=6" etc until ">=100" for the first bar. The second bar will have its 50 cells with all even numbers from ">=102" to ">=200".
So, to get to the question: is there an array formula that facilitates the process of filling a great amount of these bars with functions, without changing them all manually? Even automating *some *of this process would be great. Besides it being tedious, it leaves a lot of room for human error.
Thank you in advance to whoever's got an answer.
P
I haven't tried much as at the moment I am very confused by the vast amount of options array formulas provide. I have 48h of experience in the matter.
I suggest you to use the values of columns and rows here as helpers to do calculations. If you know that every column adds 2 and every row adds 100 you can set a formula like this for the whole range (select the whole range and add just one rule of conditional formatting):
=$A$5>((Column(D5)-3)*2+(Row(D5)-5)*100))
You use $symbol to make A5 steady and D5 value will "move" to each cell for conditional formatting, so you don't have to make an ARRAYFORMULA for this

Google Sheets - Cumulatively Add Values in Different Cells

How do you add up values in different cells?
I'm looking to create something similar to: https://i.etsystatic.com/7867478/r/il/09bb36/3897355233/il_1588xN.3897355233_koef.jpg
You will notice in the "expenses summary" box there are different descriptions such as food.
In the lower right corner, there are dropdown boxes for the category. There are multiple categories selected with varying amounts next to it.
Back to the "expenses summary" box there is a column named "actual" which adds up the values in the expenses tracker box.
In this case, this is $55 + $200 + $50 for food albeit in different boxes.
How does one add add these values up in a sheet where the category variable can be changed at anytime?
I have used vlookup to no avail. Fixing the cells would not work due to the variability of it.
There's no way of automatically modifying everything since it's notanother type of databases. The easiest way in my opinion is go to Edit - Find and Replace and Replace All those values. If the Data Validation is linked to a range, then it will be updated too

Way to make a pie chart using sum of certain cells in a column based on the tags in another column

I have a spreadsheet set up as a type of checkbook and I was wondering if given a column called "Amount" which records the various dollar amounts of the individual transatction. And another column "Reason" which the reason for a transaction is written down "rent, eating out, etc". Could I make a pie chart that will add all of the values that are in the Amount column if they have matching reasons in the Reason column.
So if I have five Reason entries listed as "rent" can I then get the sum of each cell from the Amount column that is in the same row.
Essentially I want to have a resulting chart that shows the total I'm spending on each reason with the labels that match the reason category.
--Edit
Heres an image of how my spreadsheet is set up currently with the solution of using filters to make a bar chart but I wonder if there's a better way to do this
Create a chart with Columns A (Amount) and B (Reason).
Create a filter with Column B (Reason)
Select/deselect the reason you want to include
You may also consider to filter with a slicer

Comparing each value in a column to the value in the column next to it

I'm creating an expenses spreadsheet, and I want to be able to compare what each person has paid on each item, to what is owed. If it's < what's owed, it will be red, if =>, green. I know I can manually conditionally format each cell to do this, but I'm looking for a solution I can use to simplify the sheet for month-to-month editing, with potential to add new expenses or remove them without having to later manually conditionally format the new expense.
I've looked into a few others with similar questions and tried some custom formats. First I went with the simple "if less than column [whichever it is next to] set color to red" and no luck, and one suggested a formula like this: =($H2>=$G2)*($H2<>"") though honestly I can't say I fully understand it. I have a grasp on it to a certain extent due to my coding background, but not quite enough. I feel this would be way easier if I was coding and could just use a for each statement...
I expected the cells (specifically for the greater than function) to be green, but actually it's counting all cells as less than the ones next to them, regardless of the values.
Imgur images
your issue is that the conditional formatting is offset by 1 row because you trying to apply it on range H1:H13 but formulas you use works with range H2:H & G2:G. therefore do it like this where you start from H2:

Change color of cell if sum of row drops below 2

I'm working on a sheet to help me keep track of inventory at a bookstore. Here is a watered down version. There are 19 titles in total, kept at three different warehouses. I'm working on a notification system where the top box will turn red if the sum of books in any single title drop to 3, so I know it time to restock.
How can I do that?
NOTE: I can't add another column to get the sum value. The original spreadsheet is pretty crowded as it is.
The full sheet is in the copy of Inventories.
A custom formula in conditional formatting to achieve this:
=ARRAYFORMULA(MIN(SUMIF(IF(COLUMN(C3:E3),ROW(C3:C21)),ROW(C3:C21),C3:E21))<3)

Resources