Google Image Charts - matching colors - google-visualization

I've been playing with this for the last couple of hours and it's doing my head in.
I finally got my line chart look right but for some reason the colors for the data aren't matching...
Now in my head I presume that the chco parameter matches the order of the chd parameter. But it doesn't.
Here's my parameters...
chxl=0:
16th+Oct+2011
23rd+Oct+2011
30th+Oct+2011
6th+Nov+2011
chds=a
chxt=x,y
chs=620x400
cht=lc
chco=3366CC,DC3912,FF9900
chd=t:-1
100,200,300,400
-1
400,300,200,100
-1
36,10,100,100
chdl=Total
Adults
Kids
Here's a picture of the chart. See how Total is blue on the right hand side but in the line graph it's showing up red. I don't get it.
Am I making sense?

remove -1 from chd in all three instances.
link

Related

Change color of the bar based on column on Superset

its been a month since I started using Apache Superset. I have a graph that gives the accuracy of an event occuring on a given hour shown below.
The event occuring is a column named 'prediction' which is either 'Left' or 'Right'. Is there a way to colorize the bars according to the value in 'prediction' column. If the prediction is Left then red colored bar and green colored bar when Right etc. I have checked metadata but I am not sure how I can edit it. Is there a way to achieve this?
I was able to solve it by using the 'prediction' column in breakdown function few days ago. Thank you Kamal for providing an answer as well!

Google Sheet Not Multiplying in IF Formula

I am trying to calculate a price based on rates. If the number is $20,000 or below, there is a flat rate of $700. If the number is between 20,001.01 and $50,000, the rate is 3.5% of the number. The rates continue to lower as the numbers go up. I can get Google Sheets to populate the box with $700 if it is below $20,000 but I can't seem to make it do the multiplication for me. The cell just shows C4*.035
I want it to multiply the number shown in the C4 square by the percentage listed.
Here is the code as it currently sits:
=if(AND(C4<=20000),"700",IF(AND(C4>=20000.01,C4<=50000),"C4*.035", IF(AND(C4>=50000.01,C4<=100000),"C4*.0325", IF(AND(C4>=100000.01),"C4*.03"))))
Note, I know nothing about coding so I apologize if it is sloppy or doesn't make sense. I tried to copy and format based on an example that was semi similar to mine.
try:
=IF(C4<=20000, 700,
IF(AND(C4>=20000.01, C4<=50000), C4*0.035,
IF(AND(C4>=50000.01, C4<=100000), C4*0.0325,
IF(AND(C4>=100000.01), C4*0.03))))
As BigBen noticed in his comment - there's a mistake in your formula. You should not use " " around the formula if you don't want it to be read as a string.
Actually more clean solution is using IFS formula for this task.
=ifs(C4<=20000,700,
C4<=50000,C4*0.035,
C4<=100000,C4*0.0325,
C4>100000,C4*0.03)

Is it possible to execute an IF/THEN statement using row number as the logical expression in google sheets?

I am trying to count the number of cells up to a specified row in google sheets. I want my function to basically compute "if row number is <= x, then count y". Not sure if this is possible.
TJ, I added a sheet called "Erik Help." As I stated there, I don't understand why you need script-generated custom functions to do what simple formulas can do.
The total of green rows (which I put in I2):
=COUNTIF(E2:E,"<>")
The total of yellow cells in C:C within the green range (which I put in I3):
=COUNTA(FILTER(C2:C,E2:E<>"",COUNTIF(C$2:C,C2:C)<=4))
In my added sheet, I edited the values in C:C to reflect your actual usage and applied a CF formula that highlights yellow if there are 4 or fewer repetitions. So unless I'm missing something, the two formulas above give you what you need to know without script. If you can write CF formulas to highlight certain cells, you can write similar formulas in the sheet to count those same cells fairly easily.
If I'm missing something, please clarify further.

Google Sheets hours worked before and after specified time

I am trying to specify a time that starts a shift premium for a time card. I was so happy I finally figured out how to get it, but then I changed a time to a first shift time and thats when I lost all hope. I have spent hours messing with this and my current formula's looks like
x1.05
=IF(COUNT(A20:B20)=2,MOD($B$18-A20,1)*24,"")
x1.1
=IF(COUNT(A20:B20)=2,MOD(B20-$B$18,1)*24,"")
My end goal is to have it so first shift (7am - 3pm) fall under base pay, 2nd shift (4pm-12am) fall under x1.05 and anything past 12am falls under x1.1
Just getting this far has been a mind blower for me and any help would be greatly appreciated.
I have moved this to its own sheet to share with everyone. I am still playing with things myself and trying different things, but on the sheet I have included the variables along with the wording of the contract that effects the pay scale. NOTE the times I originally provided were just examples from the top of my head.
My Sheet
It doesn't look like your current sheet accounts for the multiple criteria you're wanting to evaluate. First shift (x1) begins at 7; second shift (x1.05) begins at 15:00, and third shift (x1.10) begins at 24:00.
I added each of those directly above the columns they affect and used this formula for the Base column:
=IF(COUNT($A20:$B20)=2,IF($A20<F$18,(MOD(MIN(F$18,$B20)-$A20,1))*24,0),"")
...this for the x1.05 column:
=IF(COUNT($A20:$B20)=2,IF($A20<G$18,(MOD(MIN(G$18,$B20)-$A20,1)*24)-E20,0),"")
...and this for the x1.10 column:
=IF(COUNT($A20:$B20)=2,(MOD(MIN(E$18+1,$B20)-$A20,1)*24)-SUM(E20:F20),"")
So far, it's working as expected. One thing I didn't add into it is to account for someone who starts their shift before 7 a.m. If you want this to be included in the x1.10 column, you could add a calculation for that to the formula there.
Here's what it looks like:
I'm working in Excel, but these formulas should all work in Google Sheets as well.

Google Sheets - IF multiple cells match THEN copy third cell to a fourth cell

Example should, hopefully, be clear, but what I want is to combine an if/else with an AND-formular.
If a pupils name exist AND the pupil has solved i.e. subject 1 THEN copy the result to another cell on sheet 2.
In sheet 'JPV' I entered in B2
=ArrayFormula(if(len($A$2:$A), iferror(vlookup(B$1&$A$2:$A, {Solution2!$A:$A&Solution2!$C:$C, Solution2!$I:$I}, 2, 0)),))
and filled to the right. See if that works for you?