I've been trying to figure this out myself for the past 45 minutes and I don't think I'm any closer.
My question is regarding column T. It is calculating a running balance. I want to create an exception in how it's calculating when I enter a "balance" record (shown in column H – "Type").
See row 35 for where I'm running into this challenge. Since the record type of row 35 is "balance", I want to see 50,000 output into T35 – carried over from S35, as opposed to continuing the running balance from the previous record.
Any help?
https://docs.google.com/spreadsheets/d/1GTxEPVzBW66aV13kIlreB-3hvHpii-4SzAQyb-Wxd9Y/edit#gid=2146170730
Related
So I'm creating a Google Sheets doc that contains my hours and overtime for an hourly position I have, and how much overtime I'll need to make the amount of money I need to make to survive.
In addition to this I am also trying to track my hours so I can track the actual amount of money I'm making.
So I have a projected clock out time in Column B that uses a formula to tell me what time I need to ideally clock out at based on how many hours I need and what time I clocked in at. When I clock out, I enter the actual time I clocked out at.
In Column C I have the total amount of hours I worked that day, formatted in duration based on the difference between the value in Column A and Column B. If I haven't entered in a value in Column B, it shows me the ideal amount of hours I need that day.
I want to calculate my actual hours worked per week as I'm working that week, so I need to ONLY sum the values in Column C if the adjacent value in Column B is NOT a formula. So I need it to sum the values in column C if I've entered the actual time that I clocked out at in column B.
I've looked up this question and tried multiple solutions I've found here, even tried troubleshooting with ChatGPT, but most are just trying to sum the range that contains the values/formula, and not summing a different column based on if another column has formulas or not.
There seems to be a lot of posts that come super close but don't seem to work for how I need this to work.
Edit: Here is the example sheet.
So F3:F6 are values that have been manually entered, while F:7 has been calculated by a formula.
I need H9 to sum the values of H3:H7, but only the values adjacent to the times in the F column that have been manually entered. In this example, I need it to sum H3:H6 and ignore H7 until I enter a time and remove the formula in F7.
try:
=SUMPRODUCT(MAP(F3:F7,LAMBDA(z,IFNA(FORMULATEXT(z),1))),H3:H7)
You may filter and check if there is a formula with FORMULATEXT. If there isn't it will throw a #N/A error. Then with ISNA it will keep the values in which its adjacents did'nt have a formula:
=SUM(FILTER(C:C,BYROW(B:B,LAMBDA(b,ISNA(FORMULATEXT(o))))))
Hi I'm curious if this is even possible and just thought I'd throw it out.
I have this function in google sheets:
=ArrayFormula(TRIM(TRANSPOSE(SPLIT(QUERY(REPT(UNIQUE('Data Validation'!B3)&",",'Data Validation'!C3),,999^99),","))))
It allows me to specify the thing I want repeated as well as the number of times I want it repeated. Both of those are found in my data validation sheet which contains the following:
I am curious if there is a way to build the array formula so it essentially says:
repeat each element in column B the corresponding number of times in column C
Or in other words repeat EVP Sales 380 times then in the same output column repeat VP Inside Payments 36 times etc.
I haven't found anything remotely related to this online.
Thanks!
The formula you are using is already built for that scenario, just supply the needed range to calculate it properly
Formula:
=ArrayFormula(TRIM(TRANSPOSE(SPLIT(QUERY(REPT(UNIQUE('Data Validation'!B2:B4)&",",'Data Validation'!C2:C4),,999^99),","))))
Output:
I have a sheet used to calculate worked time. The aim is to sum up the hours and divide them in "regular" ones (up to 8h per day) and "overtime" ones (anything more than 8h per day). Each date has to have two rows(the second one is hidden by default), as there are multiple places I can work at, but the time calculated should be summed. Also, time worked on Saturday and Sunday should always be counted as overtime.
Screencap here.
The problem I have is with calculating overtime hours.
Regular hours are generated by:
=arrayformula(IFS(
WEEKDAY(A3:A70; 1)=1;0;
WEEKDAY(A3:A70; 1)=7;0;
E3:E70+E4:E70>8;8;
E3:E70+E4:E70<=8; E3:E70+E4:E70))
They are summed by =SUM(IFERROR(G3:G71;0)), which works just fine. Overtime hours are generated by:
=arrayformula(IFS(
WEEKDAY(A3:A70; 1)=1;E3:E70+E4:E70;
WEEKDAY(A3:A70; 1)=7;E3:E70+E4:E70;
E3:E70+E4:E70>8;E3:E70+E4:E70-8;
E3:E70+E4:E70<=8; 0))
And summed similarly by =SUM(IFERROR(H3:H71;0)) in H72. However, it returns a wrong value - in the sample sheet, it is 57 instead of 7
If I select the summed range, the tooltip shows the correct sum (7). If I add/remove the decimal place or change the formatting in H72, it suddenly changes to the correct one, too. However, when any new data is added (i.e. hours form a new day), it goes back to showing incorrect values.
It is not a simple display error, because the values are then imported by another sheet via =IMPORTRANGE and it imports those wrong values.
Any idea how to fix it?
Sample sheet here
try in H72:
=INDEX(SUM(IFERROR(1*H3:H71;0)))
update:
=INDEX(SUM(IFERROR(FILTER(1*H3:H71; MOD(ROW(H3:H71)-1; 2)=0); 0)))
I have a database of scores (C2:C937) which range from 4000-6500. I have the records for each score (D2:D937) and the differential between the 2 (E2:E937). I am trying to find a formula to tell me which score is closest to going over 5000. I was thinking to have a formula that checks the sums of the C column values and their corresponding E column values, and then sorting by which values have the most to improve. I don't know if it's possible to make a loop of sorts in sheets (kind of like a for loop in Java).
The image below it shows a set of values as explained above. The result I would be looking for would return whichever value has the highest chance of going over 5000, that is already the closest.
Here is a set of expected results. In this dataset, "Yanmega 4" would never be returned since it is already over 5000 in the C column. "Zangoose 1" and "Yanmega 3" would be first since they are close to going over 5000 and have enough leeway above 5000 (~400 points of leeway above it). "Zangoose 2" would be next since it has ~300 over 5000 meaning getting over 5000 should be easier than some of the others. "Zangoose 4" would be next since only 28 points need to be gained to get more than 5000, and there are 105 points of wiggle room as well. "Zangoose 3" is last since it only has 15 points of wiggle room based upon the current record.
Here is what I had started. The first line is convuluted and was my attempt at creating a loop. The second line has a good start I just don't know where to go from there. Both lines are unfinished.
=IF(IF(LARGE($C$2:$C$937,1)<5000,LARGE($C$2:$C$937,1),IF(LARGE($C$2:$C$937,2)<5000,LARGE($C$2:$C$937,2),LARGE($C$2:$C$937,3))+INDIRECT("E"&match(E954,$E$1:$E$940,0))<=5000,))
=IF(LARGE($C$2:$C$937,1)<5000,)
1st I think your logic is not correct. I would rather have Zanggose 4 as 1st, then Yanmega 3, then Zanggose 2 or Zangoose 3...
you can use a formula like:
=INDEX(B3:B8,MATCH( SMALL( IF($C$3:$C$8<5000,(5000-$C$3:$C$8)*100/$D$3:$D$8,100),*ROW($A$1:$A$6)* ), IF($C$3:$C$8<5000,(5000-$C$3:$C$8)*100/$D$3:$D$8,100),0),)
and insert the Function as Array (with ctrl+sht+enter) to as many cells as needed (paste formula in top cell, fix it, then enter as Array, then select all destination cells, press F2 to edit formula, then ectrl+sht+enter)
adjusting c3:c8 to your c928:c933 and so on, then ROW($A$1:$A$6) as big as you data.
Problem is that too many calls are made recursively and in large number of rows things will get very slow... You better use an extra Column with the formula
=IF($C$3:$C$8<5000,(5000-$C$3:$C$8)*100/$D$3:$D$8,100)
and then Filter/sort the data with VBA or Filters (there are excellent youtube videos on the subject, as long as company policies (if any) allow usage of VBA).
I need some help to calculate the moving average of the previous n days to date, given that n number is variable due to any given day can contain multiple values insertion (usually from 2 to five). So one specific day can contain several values.
This sheet is specifically related to weight tracking, here is the link:
https://docs.google.com/spreadsheets/d/1KhewGXtpElPYtjM4RpA4j2b9fkz17XcA518SPImg4p8/edit?usp=sharing
in the image you can see that for yyyy-mm-dd 2021/07/13 i want the average of the previous 54 and 55 values respectively
Thanks
I see no reason why this wouldn't be possible with a regular AVERAGEIFS() function. Did that not come up during your googling this question?
Here is a sheet created specifically for this question.
And here is the AVERAGEIFS() that I wrote in cell C3 on the MK.Help tab.
=IF(A3<A$3+C$1;;AVERAGEIFS(B:B;A:A;"<="&A3;A:A;">="&A3-C$1))