I'm trying to build a very simple inventory sheet. Apologies in advance, but I'm very new at this.
a) I'd like my inventory sheet to show stock for individual items, and for kits (BOMs)
b) I'd also like the array formula to update depending on an adjacent column value (i.e. if the row shows 'fulfilled' then the array should ignore it.
I have been able to modify an old post that I found here, but unfortunately the original document was modified. https://support.google.com/docs/thread/23230245?hl=en
Does anyone have access to that original doc? I know Matt King was involved.
Does anyone know of a beginner's guide to Google Sheets Query / Array formulas?
I know I'm speaking in gibberish, but believe me I'm fascinated with this and I'm a quick learner. Would also be interested in paid coaching if anyone's into that!
https://docs.google.com/spreadsheets/d/1btnxxI00qI9njIUzudAZXh4G87TWcHoWtfPl4jBl7jM/edit?usp=sharing
={"Units"; ArrayFormula(IFNA(VLOOKUP(B2:B, QUERY({'BOM Import'!F2:I},
"select Col1,sum(Col4)
where Col4 is not null
group by Col1
label sum(Col4)''"), 2, 0)))}
={"Total Stock on Hand"; ArrayFormula(IF("yes"=IFNA(VLOOKUP(IFNA(VLOOKUP(B2:B, {'BOM Import'!F2:F, 'BOM Import'!E2:E}, 2, 0)), SORTN(SORT({'Kits Requested'!B2:B, 'Kits Requested'!A2:D}, 2, 0), 9^9, 2, 3, 1), 5, 0)), 0,
IFNA(VLOOKUP(B2:B, QUERY({'BOM Import'!F2:J}, "select Col1,sum(Col5) where Col5 is not null group by Col1 label sum(Col5)''"), 2, 0))))}
Related
In the below spreadsheet, I am trying to find the bar with the highest sales per show. So I want the formula in cell B2 on the 'FRONT SHEET' to look at the 'BAR SALES' sheet and find the specific show, find the highest sales in that row, and then pull the bar name.
I am currently using this formula which works; however, the formula is specific to this show. I want the formula to be broader and be able to search for the show in the 'BAR SALES' sheet.
=INDEX('BAR SALES'!$B$1:$F$1,MATCH(MAX('BAR SALES'!B2:F2,'BAR SALES'!B2:F2),'BAR SALES'!B2:F2,0))
This is a dummy spreadsheet but has the gist. My actual sheet is a lot bigger so I want to be able to search a long list of shows for this information without specifically tailoring the formula to each show in that list. Can I add a vlookup in this formula somehow??
[https://docs.google.com/spreadsheets/d/1dcjjQyZj9ANUTyTMloiY2CX94nBSYLt5hCiSWzY3tBk/edit#gid=1376876918][1]
use:
=ARRAYFORMULA(IFNA(VLOOKUP(A2:A, SORTN(SORT(SPLIT(
FLATTEN('BAR SALES'!A2:A&"×"&'BAR SALES'!B1:F1&"×"&'BAR SALES'!B2:F),
"×"), 3, 0), 9^9, 2, 1, 1), 2, 0)))
This is a slightly longer version of #player0's. Either will return the same response. They both do a FLATTEN and then a SPLIT to generate three columns. Test each out with your data to see if either is faster. They should be roughly the same, but its worth testing.
=ARRAYFORMULA(
IF(ISBLANK(A2:A),,
IFERROR(
VLOOKUP(
A2:A,
QUERY(
SPLIT(
FLATTEN(
IF(ISBLANK('BAR SALES'!A2:A),,
'BAR SALES'!A2:A&"|"&'BAR SALES'!B1:F1&"|"&'BAR SALES'!B2:F)),
"|"),
"where Col3 is not null
order by Col3 desc"),
2,FALSE))))
I am creating a scheduling system for my company. I have tried this a few ways and I am not getting anywhere. I need the corresponding date that an employee is off to show "TRUE". Since I am using VLOOKUP for this, I am only getting the first value. I am using the following formula in cell F2.
=arrayformula(ifna(if(vlookup($E2:$E62,$A$2:$C$15,2,false)=F$1:L1,true,""),""))
I have highlighted the issue. Can someone take a look at this and point me in the right direction?
Sample spreadsheet: https://docs.google.com/spreadsheets/d/1e7b2aiGRH9Mm2mB2A_d4uavXQeCKrW3vXgMcnYtAfRM/edit#gid=0
use in F2:
=ARRAYFORMULA(IF(ISNUMBER(IFNA(VLOOKUP(E2:E, QUERY(QUERY({A2:B},
"select Col1,max(Col1) where Col2 is not null group by Col1 pivot Col2"),
"select Col1,Col3,Col5,Col4,Col2"), {2, 3, 4, 5}, 0))), TRUE, ))
I'm creating a Budget calculator spreadsheet in Google Drive, I'm trying to update cells from another Sheet with certain criteria:
This is Sheet1:
According to the date and category should update a cell from another Sheet in the same document, with the quantity.
This is Sheet2:
I'm not sure If I'm able to implement this flow in the same Google spreadsheets or if I should use Python instead. I tried everything and I'm stuck here. If someone could give me a hint about it I'll appreciate it a lot.
Here's the link to the spreadsheet: https://docs.google.com/spreadsheets/d/1BEtKJGVOdVF8PLxcR_96cPjE_4XH0QFbtV9dynroly0/edit?usp=sharing
try this cobra query in B13:
=INDEX(IFNA(VLOOKUP(A13:A21, QUERY({Sheet2!A3:D;
TO_DATE(SEQUENCE(12, 1, 2, 33)), 0/SEQUENCE(12, 3,,)},
"select Col2,sum(Col4)
where Col2 is not null
group by Col2
pivot month(Col1)-1"), SEQUENCE(1, 12, 2), )))
I believe what I am trying to do should be simple in Google Sheets formulae, but any solution based on an Excel formula should be easily transferable.
Because additional characters will be added periodically, I have a named range: "Heroes".
Heroes
Bilbo
Gandalf
Saruman
Wormtongue
Tom Bombadil
For each hero, I have a worksheet in one overall workbook. On these worksheets, there are columns for Date, Time, Quest, and Count. Several times per day, a hero will venture out on a quest of a certain type, returning with a certain count as a prize. Each venture has its own row distinguishable by date and time. Eg-:
Date
Time
Quest
Count
12/4
3:00P
Ring
9
12/5
8:00A
Mordor
6
12/5
4:15P
Sting
3
Meanwhile, I have a summary worksheet, on which I am manually entering (for now... bonus points to help create an =arrayformula() or equivalent to grab all unique date/time combinations from each character's worksheet) the date and time at which one or a batch of heroes are sent to quest. I am trying to figure out the formula template that will sum the counts for each quest type for each hero at the specific date and time signified by its corresponding row (starting at 12/4, 3:00P, Ring, the count should be 9, for example, which is Bilbo's prize for questing at that time; of course, other heroes are also sent out at 3:00P, resulting in prizes for the other quests, and multiple heroes may venture on the same type of quest at any given time):
Date
Time
Ring
Sting
Mordor
Moria
12/4
3:00P
9
3
4
1
12/4
9:30P
1
0
8
0
12/5
8:00A
5
3
6
9
12/5
12:10A
3
1
3
8
12/5
4:15P
4
5
2
5
Since not every date and time in the summary sheet will exist on each hero's worksheet, I seem unable to use "SUMIFS", which functions in such a way that each sum_range and criteria_range are added on only across the same row when conditions are met. I think there is a SUMPRODUCT(), or INDEX(MATCH()) way to do this, but when including the named range to read across multiple worksheets, only the first hero's numbers were added in my tinkering with this.
I'm dancing around the solution here. Anyone care to tango ? Many thanks !
Sample Workbook for support: https://docs.google.com/spreadsheets/d/142IE9r2ip6YHsGdMr-zt_IHd6W7glqUId_UiGQnCUZs/edit?usp=sharing
it would be done like this:
=QUERY({Bilbo!A:D; Gandalf!A:D; Saruman!A:D; Wormtongue!A:D; 'Tom Bombadil'!A:D},
"select Col1,Col2,sum(Col4) where Col1 is not null group by Col1,Col2 pivot Col3", 1)
if you want a specific order of places you can do:
=TRANSPOSE(SORT(TRANSPOSE(QUERY(
{Bilbo!A:D; Gandalf!A:D; Saruman!A:D; Wormtongue!A:D; 'Tom Bombadil'!A:D},
"select Col1,Col2,sum(Col4) where Col1 is not null
group by Col1,Col2 pivot Col3", 1)),
MATCH(FLATTEN(QUERY(QUERY(
{Bilbo!A:D; Gandalf!A:D; Saruman!A:D; Wormtongue!A:D; 'Tom Bombadil'!A:D},
"select Col1,Col2,sum(Col4) where Col1 is not null
group by Col1,Col2 pivot Col3", 1), "limit 0", 1)),
{"Date"; "Time"; "Ring"; "Sting"; "Mordor"; "Moria"}, ), 1))
or manually like this:
=QUERY(QUERY({Bilbo!A:D; Gandalf!A:D; Saruman!A:D; Wormtongue!A:D; 'Tom Bombadil'!A:D},
"select Col1,Col2,sum(Col4) where Col1 is not null group by Col1,Col2 pivot Col3", 1),
"select Col1,Col2,Col5,Col6,Col3,Col4")
if you thinking to outsmart it with the list of Heroes... don't. referring a range from other sheets requires the usage of INDIRECT. and surprise surprise, INDIRECT is not supported under ARRAYFORMULA so you cant build an array. at this point, you either re-think your life choices or you use a script where there is support for such indirected arrays. the best you can do without script is to hardcode it like:
=QUERY({
INDIRECT(Main!A2&"!A:D");
INDIRECT(Main!A3&"!A:D");
INDIRECT(Main!A4&"!A:D");
INDIRECT(Main!A5&"!A:D");
INDIRECT(Main!A7&"!A:D")},
"select Col1,Col2,sum(Col4) where Col1 is not null
group by Col1,Col2 pivot Col3", 1)
and ofc this will only work if sheet exists on the list and list does not contain empty cells otherwise you will get ARRAY error like this because Main!A6 sheet does not exist:
so to counter it we can do some slide of hand tricks with IFERROR which will allow us to not get the error and still use non-existent sheets and even empty cells so we can pre-program it for future additions like this:
=QUERY({
IFERROR(INDIRECT(IF(Main!A2="", 0, Main!A2)&"!A:D"), {"","","",""});
IFERROR(INDIRECT(IF(Main!A3="", 0, Main!A3)&"!A:D"), {"","","",""});
IFERROR(INDIRECT(IF(Main!A4="", 0, Main!A4)&"!A:D"), {"","","",""});
IFERROR(INDIRECT(IF(Main!A5="", 0, Main!A5)&"!A:D"), {"","","",""});
IFERROR(INDIRECT(IF(Main!A6="", 0, Main!A6)&"!A:D"), {"","","",""});
IFERROR(INDIRECT(IF(Main!A7="", 0, Main!A7)&"!A:D"), {"","","",""});
IFERROR(INDIRECT(IF(Main!A8="", 0, Main!A8)&"!A:D"), {"","","",""});
IFERROR(INDIRECT(IF(Main!A9="", 0, Main!A9)&"!A:D"), {"","","",""});
IFERROR(INDIRECT(IF(Main!A10="", 0, Main!A10)&"!A:D"),{"","","",""});
IFERROR(INDIRECT(IF(Main!A11="", 0, Main!A11)&"!A:D"),{"","","",""})},
"select Col1,Col2,sum(Col4) where Col1 is not null
group by Col1,Col2 pivot Col3", 1)
note: 4 columns in range A:D = 4 empty cells {"","","",""}
I'm pretty new to formulas and just joined the forum, but I'm completely stumped on a pet project I've been doing for work using Google Sheets. I'm trying to create this sheet to be a feeder page for a product upload template that I designed. I'm pretty sure what I'm trying to do can be done, but I think I've taken this as far as I can by following examples from the internet. Basically, there's a list of skus filled into column F and several drop menu's in column C with options of how to sort that list. Every option in the drop menu corresponds with a named range, and all of the named ranges are sorted and displayed in columns AP-BJ.
The 4 'initial parent sku' drop menu's (C4-C7) are supposed to filter the full list of skus and return only those that match with the chosen named-range option into the corresponding column U, Z, AE or AJ - preferably as an array and removing blank lines. It is currently set up to detect a string within the sku instead of basing the search on a named range. For testing purposes, the lists displayed in columns U, Z and AE are correct using this formula in U3: [=IF(C4="","",INDEX(FILTER(F$3:F,SEARCH(C4,F$3:F))))]
The 12 'secondary parent sku' drop menu's (C9-C24) are then meant to reference the lists created by the initial parent filter (U, Z, AE or AJ) and sort those lists one step further. I'm sure it's a clunky mess since I'm learning as I create this, but I finally got it to sort-of work by using the following IFS statement with multiple conditions [=iferror(ifs(C$9="High",INDEX((High),(MATCH(U3:U,AZ$3:AZ,0))),C$9="Lux",INDEX((Lux),(MATCH(U3:U,BB$3:BB,0))),C$9="DIA",INDEX((DIA),(MATCH(U3:U,AX$3:AX,0))),C$9="Gem",INDEX((Gem),(MATCH(U3:U,BD$3:BD,0)))))].
The biggest problem is speed. I haven't even included all of the named ranges that are available in the drop menu's or copied the formula into all 12 columns it would need to be in, and the sheet is hanging while trying to work through the formulas. Speed issue aside, it also doesn't seem to work if I add an array formula to the beginning and some skus are 1000's of rows. It would be nice to remove the blank lines but I can't seem to work that into the formula without breaking it, either.
Any tips, help, or advice on material to reference would be so appreciated.
Screenshot of sheet
Link to sample of sheet:
https://docs.google.com/spreadsheets/d/1fnHwaaPOKyKv9rek_Hhajb_8_vU4ssVV/edit?usp=sharing&ouid=109394567075019147581&rtpof=true&sd=true
try U3:
=IFNA(QUERY(IFNA(FILTER(AP3:BJ, AP2:BJ2=
VLOOKUP(C4, {Calculations!O56:O, Calculations!N56:N}, 2, 0))),
"where Col1 is not null", 0))
V3:
=IFNA(QUERY(IFNA(FILTER(AP3:BJ, AP2:BJ2=C9), FILTER(AP3:BJ, AP2:BJ2=
VLOOKUP(C9, {Calculations!O56:O, Calculations!N56:N}, 2, 0))),
"where Col1 matches '"&TEXTJOIN("|", 1, O3:U)&"'", 0))
W3:
=IFNA(QUERY(IFNA(FILTER(AP3:BJ, AP2:BJ2=C10), FILTER(AP3:BJ, AP2:BJ2=
VLOOKUP(C10, {Calculations!O56:O, Calculations!N56:N}, 2, 0))),
"where Col1 matches '"&TEXTJOIN("|", 1, O3:U)&"'", 0))
X3:
=IFNA(QUERY(IFNA(FILTER(AP3:BJ, AP2:BJ2=C11), FILTER(AP3:BJ, AP2:BJ2=
VLOOKUP(C11, {Calculations!O56:O, Calculations!N56:N}, 2, 0))),
"where Col1 matches '"&TEXTJOIN("|", 1, O3:U)&"'", 0))
Y3:
=IFNA(QUERY(IFNA(FILTER(AP3:BJ, AP2:BJ2=C12), FILTER(AP3:BJ, AP2:BJ2=
VLOOKUP(C12, {Calculations!O56:O, Calculations!N56:N}, 2, 0))),
"where Col1 matches '"&TEXTJOIN("|", 1, O3:U)&"'", 0))