Percentile with multiple conditions in google sheets [closed] - arrays

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 months ago.
Improve this question
I have a sheet called "main" with 4 columns like this :
I want to make a percentile of column N, with condition of column A, C, and J
I tried with function PERCENTILE(IF((x)*(y)*(z),aa),0.5) and works for
queue_name = "idecbi-prod",
grass_week = "2022-09-05",
and task_user = "di_scheduler",
Desired Answer :
it works just fine with these conditions,
But when I tried to use another condition such as "idecbi-dev" or "ad-hoc" or another grass_week, it become error like this
Whereas the only thing i change is only O4 to O5 and N4 to N5
The data seems fine and we have all the conditions as shown in the first picture (main sheet).
Is there anything that I miss ?
Here's dummy data that I've created for better understanding.
https://docs.google.com/spreadsheets/d/1ejhxVTayWjrUAZ6NE78AXx2pENvlhGDstMXwrDfqv_0/edit?usp=sharing
I'm trying to make cell D4 works as fine as D3

wrap it into ARRAYFORMULA:
=ArrayFormula(PERCENTILE(IF((main_week=A3)*(main_queue=C4)*(main_task_usage=B4),main_avg_exectime),0.5))

Related

How to sort an array in a way that if a condition is met the contents get sorted first? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed last month.
Improve this question
I need to sort an array of orders so that the ones already on delivery get put at the end of the list so to put the unfinished orders on the top.
The variable state is what i wanted to sort on. If the variable is 0 the contents should have a higher priority than where the state is 1.
Here is a simplification of what i need:
input array:
{{state=1,...},{state=0,...},{state=0,...},{state=0,...},{state=1,...}}
=>
output array:
{{state=0,...},{state=0,...},{state=0,...},{state=1,...},{state=1,...}}
I tried table.sort and some other methods but it didn't fit what i needed or didn't do what i wanted it to do.
table.sort(arr, function(a, b) return a.state < b.state end) works fine to sort arr in non-descending order based on the state field of each entry. How did you try to use table.sort?

Sumif (google sheets) but data is every nth cell in a column, every nth column based on cell n-4 [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 months ago.
Improve this question
Im trying to make a budget tracker
Is there a way i can sum every nth cell in a column if the n-4 is a specific string?
I found this but not sure how i can add a "=person A" to the criteria.
Is there a better way to format this data ?
try in C2 and drag to the right:
=INDEX(BYROW(REGEXREPLACE($A2:$A3, "(?i)total ", ),
LAMBDA(T, SUM(IFNA(FILTER(C7:C15, C4:C12=T))))))
⠀‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀

Removing Both Ends of a String in Google Sheets [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 months ago.
Improve this question
I have a Google Sheet which is constantly being populated via a Zapier zap. In one of the columns, I receive a PayPal "descriptor" which contains a unique identifier I need to do some look ups on other tabs within the same document.
Can someone point me in the direction of the correct REGEX to use to strip off the front and end of the string, for example:
Annual Fee-66421763-07142022191540
I would like to just have the piece in between the hyphens so the output reads simply:
66421763
Now, the front section will likely always read the same, the middle (the piece I want to extract) will be different and could change length too, as will the end section after the dash.
Any suggestions on how to achieve this would be great.
try:
=REGEXEXTRACT(A1; "-(\d+)-")

VBA Merging two or more totals based on user input, then delete the originals [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Hello Im very new to VBA and am currently working with this issue, im trying to merge two or more totals
based on user input as to the company name, example of the list:
2nd Cup 1937168
A & W 6485425
Applebee's 1550895
Arby's 8382549
Archie Burger 86776
The user needs to input the names of the companies they want to merge and this will create a new company with the total sum of the combinations, finally deleting the entries off the original list.
I currently am looking into an array for this but am not sure how it would work.
Any help would be vastly appreciated!
For a user-friendly approach, you can use a userform with an associated mult-select, multi-column listbox (for the original data) and a textbox (for the new company name) and then write the code to process your data.
A good tutorial to get you started, from one of our SO experts, can be found here

Optimize SUMIFS formula [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I basically have a super long formula that I need to shrink. So basically I have a pivot table that allows a manager to select two work locations or both and one to twelve months.
This is how the formula looks. Only thing that changes are cell I and J->K. Would I need to set this up in a array?
=SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$3,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$J$2)+SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$4,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$J$2)+SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$5,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$J$2)+SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$6,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$J$2)+SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$7,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$J$2)+SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$8,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$J$2)+SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$9,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$J$2)+SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$10,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$J$2)+SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$11,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$J$2)+SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$12,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$J$2)+SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$13,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$J$2)+SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$14,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$J$2)+SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$3,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$K$2)+SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$4,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$K$2)+SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$5,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$K$2)+SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$6,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$K$2)+SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$7,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$K$2)+SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$8,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$K$2)+SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$9,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$K$2)+SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$10,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$K$2)+SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$11,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$K$2)+SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$12,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$K$2)+SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$13,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$K$2)+SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$14,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$K$2)
This formula should give the same result
=SUMPRODUCT(SUMIFS('owssvr(1)'!C:C,'owssvr(1)'!$IR:$IR,$I$3:$I$14,'owssvr(1)'!$IQ:$IQ,'Summary KPI'!$J$2:$K$2))
Assuming you want to sum for all combinations then you can have at most one vertical and one horizontal range as criteria in SUMIFS (so $I$3:$I$14 and 'Summary KPI'!$J$2:$K$2 qualify as those).
SUMIFS then returns an array of 12x2 values (the same dimensions as your criteria) and SUMPRODUCT sums all those to get the correct result (used instead of SUM so that "array entry" is not required)

Resources