I want to speed up work in my catering company. I have an excel file with all the ingredients of all products.
For example:
https://docs.google.com/spreadsheets/d/1-AFHpl8aoIiMXz2RE1Xv7JcI7pCIMQfMoq-lQJBx5Gw/edit?usp=sharing
=ARRAYFORMULA(TRIM(SPLIT(TRANSPOSE(SPLIT(TRANSPOSE(QUERY(TRANSPOSE(QUERY(TRANSPOSE(
IF(master!E3:Z<>"", master!A3:A&"♦"&master!B3:B&"♦"&master!E1:1&"♦"&master!E3:Z&"♠", ))
, , 500000)), , 500000)), "♠")), "♦")))
=ARRAYFORMULA(QUERY({C2:C,VALUE(D2:D)},
"select Col1,sum(Col2)
where Col1<>''
group by Col1
order by Col1
label sum(Col2)'Total',Col1'Shopping List'"))
The following formula would work for one recipe:
=TRANSPOSE(FILTER({E1:K1;QUERY(A1:K5,"SELECT E,F,G,H,I,J,K WHERE A='"&H25&"'", FALSE)}, NOT(ISBLANK(QUERY(A1:K5,"SELECT E,F,G,H,I,J,K WHERE A='"&H25&"'", FALSE)))))
(I put this as an example into cell I25).
Related
I'm not too savvy with programming, so bear with me. The data is of the players' names and fighters in a fighting game, with the table as below:
I'm making a leaderboard where it will show which fighter each player uses most. I found a formula that shows which fighter is used the most in general using the following formula:
=index(query({E2:E,G2:G},
"select Col1,count(Col1)
group by Col1
order by count(Col1) desc"), 2, 1)
The problem is, I don't understand how to make a formula that checks the player's name before returning the most used fighter from two columns. What I'm after is a result like so:
Thanks in advance!
Formula
=ArrayFormula(
{QUERY(QUERY({SPLIT("Wins"&"|"&UNIQUE({D2:D;F2:F}&"|"&"."),"|");SPLIT("Loss"&"|"&UNIQUE({D2:D;F2:F}&"|"&"."),"|");
SPLIT("Wins"&"|"&FILTER(D2:D&"|"&E2:E,D2:D<>""),"|");
SPLIT("Loss"&"|"&FILTER(F2:F&"|"&G2:G,F2:F<>""),"|")},
"select Col2,count(Col3)-1 where Col2!='.' group by Col2 pivot Col1"),"select Col1,Col3,Col2,Col3/Col2,Col3/(Col3+Col2) order by Col3 desc label Col1 'Name',Col2 'Loss',Col3 'Wins',Col3/Col2 'W/L',Col3/(Col3+Col2) 'Win Rate %' format Col3/Col2 '0.0',Col3/(Col3+Col2) '#.0%'"),
VLOOKUP(INDEX(QUERY({D2:D},"select Col1,count(Col1) where Col1!='' group by Col1 order by count(Col1) desc label Col1 'Name'"),0,1),QUERY({D2:E;F2:G},"select Col1,Col2,count(Col2) group by Col1,Col2 order by Count(Col2) desc label Col1 'Name',Col2 'Most Used Character'"),2,0)})
Note:
column Wins/Loss cannot be calculated when Loss=0 .
Hope you're okay with that
I am looking to build a formula that will check columns for a true value and if true return the first column name, in order...
Below is the formula I have been trying to build but it is not working as expected although I think I am close.
=ARRAYFORMULA(IF(HLOOKUP($A16,{Sheet1!$B$2:$E$5,Sheet2!$B$8:$E$11},{3,4,5},0)=TRUE,{Sheet2!$A$3:$A$5,Sheet1!$A$3:$A5,""))
Let me illustrate. Sheet 1 and Sheet 2 contain names with who has what (checkbox items). With a formula in cell B16 that will populate both to the right and down with all the names that contain a TRUE value in the looked up value (A:A).
Above image was manually typed in, the formula does not work at all.
Please help!
EDIT: Link to sheet
try:
=INDEX(IFERROR(VLOOKUP(A14:A, SUBSTITUTE(REGEXREPLACE(SPLIT(FLATTEN(
QUERY(SUBSTITUTE(QUERY(SPLIT(FLATTEN(
IF({B3:E5; B9:E11}=TRUE,
{B2:E2&"♦"&A3:A5&"♣"&ROW(A3:A5);
B8:E8&"♦"&A9:A11&"♣"&ROW(A9:A11)}, )), "♦"),
"select max(Col2) where Col2 is not null group by Col2 pivot Col1"),
" ", "♥"),,9^9)), " "), "(♣\d+)", ), "♥", " "),
SEQUENCE(1, COUNTUNIQUE(B2:E2, B8:E8))+1, 0)))
demo sheet
Here is another approach (similar to player0's, but different enough to warrant the separate answer:
=ArrayFormula(IFERROR(TRIM(SPLIT(VLOOKUP(FILTER(A3:A,A3:A<>""),REGEXREPLACE(SPLIT(FLATTEN(QUERY(QUERY(SPLIT(QUERY(FLATTEN({IF(Sheet1!B2:E<>TRUE,,Sheet1!B1:E1&"~|"&Sheet1!A2:A&",");IF(Sheet2!B2:E<>TRUE,,Sheet2!B1:E1&"~|"&Sheet2!A2:A&",")}),"Select * WHERE Col1 Is Not Null"),"|"), "Select MAX(Col2) where Col2 IS NOT NULL GROUP BY Col2 PIVOT Col1"),, 9^9)),"~"),"[,\s]+$",""),2,FALSE),","))))
I've added it into your spreadsheet in a new sheet ("Erik Help").
If you have more than two sheets' to include, just find this section of the formula and continue the pattern:
{ IF(Sheet1!B2:E<>TRUE,,Sheet1!B1:E1&"~|"&Sheet1!A2:A&","); IF(Sheet2!B2:E<>TRUE,,Sheet2!B1:E1&"~|"&Sheet2!A2:A&",") }
On this sheet, I've been working on I have the info I need adjusting down into the Query Results
=QUERY(Investors!A4:D,
"select B,C,sum(D)
where B is not null
group by B,C
label sum(D)''")
How do I get the Stock Numbers Due that day to be listed out in column D? Like this:
1. 10/7/2019 Grady Johnson $100.12 PT-1013
2. 11/15/2020 Bill Jones $553.80 PT-1020, PT-1019
3. 11/15/2020 Grady Johnson $45.00 PT-1011
4. 11/15/2020 Steve Robinson $320.00 PT-1018, PT-1016
5. 11/17/2020 Jim Luke $1,057.20 PT-1009, PT-1008, PT-1007, PT-1006
6. 11/22/2020 Jim Luke $300.43 PT-1010
Here's the link: Google Sheet
Any help is appreciated!
or paste this in row 3 and drag down:
=JOIN(", ", IFNA(FILTER(Investors!A$4:A, Investors!B$4:B&" "&Investors!C$4:C=A3&" "&B3)))
try:
=ARRAYFORMULA(REGEXREPLACE(IFNA(VLOOKUP(TO_TEXT(A3:A)&" "&B3:B,
TRIM({TRANSPOSE(QUERY(TRANSPOSE(QUERY(QUERY({Investors!A4:C},
"select Col2,Col3,count(Col2) where Col2 is not null group by Col2,Col3 pivot Col1"),
"select Col1,Col2 offset 1", 0)),,9^9)),
TRANSPOSE(QUERY(TRANSPOSE(IF(QUERY(QUERY({Investors!A4:C},
"select count(Col2) where Col2 is not null group by Col2,Col3 pivot Col1"),
"offset 1", 0)="",,
QUERY(QUERY({Investors!A4:A&",", Investors!B4:C},
"select count(Col2) where Col2 is not null group by Col2,Col3 pivot Col1"),
"limit 0", 1))),,9^9))}), 2, 0)), ",$", ))
Here is my suggested formula to be placed in Combined!D3 of your sample spreadsheet:
=ArrayFormula(IF(A3:A="",,SUBSTITUTE(TRIM(TRANSPOSE(QUERY(TRANSPOSE(IF(VLOOKUP(TRANSPOSE(FILTER(Investors!A4:A,Investors!A4:A<>"")),{Investors!A:A,Investors!C:C&Investors!B:B},2,FALSE)=B3:B&A3:A,TRANSPOSE(FILTER(Investors!A4:A,Investors!A4:A<>"")),))," ",COUNTA(Investors!A4:A))))," ",", ")))
As for how it works, that would be time-consuming to explain. (More time than is reasonable for a free site such as this.) I will suggest that, if this is important to you, take the time to study it. Take it apart and see what each piece does — separately and then in combination with other parts — until you've gotten it all back together.
I need to concatenate the city names that a person has been to into another cell but they have to be repeated every time the name of the person comes up.
I tried using COUNTIF but couldn't get me anywhere.
I don't wanna use VB code; just formulas/functions.
Any ideas?
Here's the link to my spreadsheet
use:
=ARRAYFORMULA(REGEXREPLACE(IFNA(VLOOKUP(B2:B,
TRIM(SPLIT(TRANSPOSE(TRIM(QUERY(QUERY({A2:A&",", B2:B&"♦"},
"select max(Col1) where Col1 <> ',' group by Col1 pivot Col2")
,,99^99))), "♦")), 2, 0)), ",$", ))
I'm making a bonus model for work. There are a lot of article numbers that the sheet has to check.
Right now I'm using this:
=SUMIFS(Data!$K$2:$K;Data!$I$2:$I;AA$2;Data!$G$2:$G;$A14)+
SUMIFS(Data!$K$2:$K;Data!$I$2:$I;AB$2;Data!$G$2:$G;$A14)+
SUMIFS(Data!$K$2:$K;Data!$I$2:$I;AC$2;Data!$G$2:$G;$A14)+
SUMIFS(Data!$K$2:$K;Data!$I$2:$I;AD$2;Data!$G$2:$G;$A14)
etc
etc
Is there a way to combine everything in one Formula? AA2:AD2 doesn't work...
I hope I'm explaining it right :)
https://docs.google.com/spreadsheets/d/e/2PACX-1vRO-4tOpgZD97cvDEAjoCz-xK-7YhrjpzRlUBplpXOrwgssE2VYjuzdX3oBZdbNVk924J6La-Vy-52_/pubhtml
I'm confused with how your data works a bit. But am I right that you want to check for each salesperson if they sold any of the article numbers, and if that's the case sum the column C?
Like so?
Formula I used translates to:
{=SUMPRODUCT(($A$2:$A$107=F2)*($B$2:$B$107=TRANSPOSE($E$2:$E$15))*($C$2:$C$107))}
And needs to be confirmerd through CtrlShiftEnter
How about :
=SUMIFS(Data!$K$2:$K;Data!$I$2:$I;AA$2;Data!$I$2:$I;AB$2;Data!$I$2:$I;AC$2;Data!$I$2:$I;AD$2;Data!$G$2:$G;$A14)
Still trying to find a way to combine criteria...
Well, played and depending what your data is, and if you can control it then something like this may help:
N9:
=QUERY({A3:C}, "select Col1,sum(Col3)
where Col1 is not null
group by Col1
label sum(Col3)''")
H9:
=TRANSPOSE(QUERY({A3:C}, "select Col1,sum(Col3)
where Col1 is not null
group by Col1
pivot Col2
label sum(Col3)''"))
E9:
=QUERY({A3:C}, "select Col2,sum(Col3)
where Col2 is not null
group by Col2
label sum(Col3)''")
E3:
=QUERY({A3:C}, "select Col1,sum(Col3)
where Col1 is not null
group by Col1
pivot Col2
label sum(Col3)''")