Array Formula not auto-filling in Google Sheets? [Example Provided] - google-sheets

I have a spreadsheet that will not auto fill my array formula. Can someone please explain what I might be doing wrong on this? Example Spreadsheet (Editable)
Essentially, I'm looking through a messy tag field trying to pull out the important tag I need displayed in a separate cell. I want this done automatically so I don't have to keep pulling down my formula every morning to update the ticket sales pivot report.
A1: fe220608-dcba-12p,mg220606-dcba,reg_confirm_sms_test,confirmation_sms_mc-guidebook,mailed_v2-guidebook,preview_reminder_call_1st_attempt,phase-preview-attendee,phase-preview-buyer,product_path_quickstart,product_workshop_registration,pb,me220624-dcba,pb_mg220606-dcba,pp_2023_pre_sale,pp-2023_guest-ticket_platinum,**pp-2023_ticket_platinum**,branding_package,branding_ob_form_finished,2022_webinar_test1_group,unsubscribed_mfcp-investor-related
(I want to pull out that Platinum tag, and put it in a separate column)
Formula: =ArrayFormula(IFERROR(INDEX({"pp-2023_ticket_general-seating","pp-2023_ticket_general-admission","pp-2023_ticket_silver","pp-2023_ticket_gold","pp-2023_ticket_platinum"},MATCH(TRUE,ISNUMBER(SEARCH({"pp-2023_ticket_general-seating","pp-2023_ticket_general-admission","pp-2023_ticket_silver","pp-2023_ticket_gold","pp-2023_ticket_platinum"},A2)),0)),""))
Expected Result:
**pp-2023_ticket_platinum**
Please let me know if there is an easier way to automate this.

use:
=ARRAYFORMULA(BYROW(A2:A, LAMBDA(x, IFERROR(INDEX({
"pp-2023_ticket_general-seating","pp-2023_ticket_general-admission",
"pp-2023_ticket_silver","pp-2023_ticket_gold","pp-2023_ticket_platinum"},
MATCH(TRUE, ISNUMBER(SEARCH({
"pp-2023_ticket_general-seating","pp-2023_ticket_general-admission",
"pp-2023_ticket_silver","pp-2023_ticket_gold","pp-2023_ticket_platinum"}, x)), ))))))

Related

proportion formula google sheets

im am still doing my google sheets test and need help finding the answer to the question: what proportion of products are discontinued. i have to express my answer in a formula on google sheets
you can find the link to the data stack here:
products list:
https://docs.google.com/spreadsheets/d/1m67VmLZispyTwFTmPdppsdJNtbvnZsZK2LBCSchUWmU/edit?usp=sharing
my idea was to count the 0 in the column J(discontinued) with the formula: =Countif(J2:J78,"0"). in the next step i would have to show a proportionality and i have no clue how i am supposed to do that. could anyone tell me if the first step is correct and how i should go about the proportionality?
thank you!!
You can also use the formula PERCENTIF:
Returns the percentage of a range that meets a condition.
PERCENTIF(range, criterion)
In this case if you want to know the percentage of 0 this would be:
=PERCENTIF(J2:J78;"0")
You do not need any formula, just build a pivot table

how can I write a formula that uses a cell's contents when building a range reference to the name of another sheet?

I have a large Google Sheets spreadsheet that has individual sheets for financial statements of activity for multiple years. I want to reference particular columns of those in other sheets, and I've successfully figured out how to do that with an HLOOKUP function. However, because I want to do this for multiple years, I'd like that HLOOKUP function to pick up the name of the sheet to reference from its column header. Right now, I'm hard-coding it like this—you can see the HLOOKUP range refers to cells in the "2021 Overall" sheet. The hard-coded approach works but makes adding a new year tedious. Ideally, the HLOOKUP formula would read the contents of its column header cell to determine which year it is.
As best I can tell, the solution is to use INDIRECT, but I can't figure out any way to build the formulate with INDIRECT and not get an error. For instance, this seemed like it should work. As you can see, I have 2021 in cell D4, and my INDIRECT statement is referencing that and building the rest of the range.
I've also tried using INDIRECT with an explicit CONCATENATE, with no more success.
Any ideas for how to look up that D4 cell and slide it into the HLOOKUP range?
Thank you!
Try to remove the "'"& before D4 and the ' after the Overall.
Your formula should look like this:
=IFERROR(HLOOKUP($A$2,INDIRECT(F4 &" Overall!$A$5:$X$150", Utility!$A10, FALSE)))
With Nikko's nudges in the right direction, I eventually figured out the right format. This allows the formula to work in multiple sheets and to be filled right (for more years) and down (for more classes).
=IFERROR(HLOOKUP($A$2,INDIRECT("'"D$4&" Overall'!$A$5:$X$150"), Utility!$A3, FALSE))
Note that if you try to replicate this, you may need to type the formula out from scratch—I had a problem where pasting it in didn't work. Once I'd retyped it and Google Sheets acknowledged it, it worked from then on in the spreadsheet, even when pasted from sheet to sheet.

How can I use the COUNTA in ArrayFormula?

I've been trying to use ArrayFormula & COUNTA functions to achieve the result below:
I want the result to be like this
I want to count the number of the words in each field, and I am trying to drag formula down automatically when the sheet has new fields. I came up with this formula: =ARRAYFORMULA(COUNTA(transpose(split(join(char(10),$A2),char(10)))))
But when I add in new fields, the automation doesn't work. I also try to replace $A2 with $A2:A but I still couldn't automate it.
The current situation
Any thoughts would be appreciated!
Here is something that may work for you if you put this in B2:
=INDEX(IF(A2:A="","",LEN(REGEXREPLACE(A2:A&CHAR(10),"\S+(\n)","1"))))

Using =GetPivotData in GoogleSheet to get specific Grand Total

I'm trying to use =GetPivotData formula to dynamically pull specific sum totals (40% & 80% Sell-Out Probability in my example) into a table. I may not fully understand how to use the formula, but everything I've tried has returned an error.
Sample Sheet
This formula seems to pull the answer you want, if I understand your question.
=GETPIVOTDATA("SUM of Sales",H2,"Sell-Out Probability","40%")
This would go in N8 of your sample sheet.
N9 would have the same formula, but with "80%" as the last value.
Let me know if this helps.

Using a Named Range to identify worksheets to use a SUMIFS on a to add an array of data

Below is a sample of the Google Sheet I'm working on:
https://docs.google.com/spreadsheets/d/1LDsfn_FMdUSfuFZAyuXf5gdlOSN9yLqhT1RY8aX7Nfs/edit?usp=sharing
On the spreadsheet Team Totals, I'm trying to calculate all the sales based on the date, the type of sale, and the program type starting from Row 27.
The problem I have run into is that the Named Range, Consultants, only pulls the data from the first cell of the Named range (Octo). What I want is for a formula that will pull the data of the selected range from each entry in the named range and sum them together.
For reference, I put what the proper values should be starting from Row 33.
The closest example I have seen was from this website: https://www.got-it.ai/solutions/excel-chat/excel-tutorial/sumif/sumif-across-multiple-sheets
However, I get the same problem that only the first cell in the named range gets pulled.
I feel like I'm missing something simple, but I have been bouncing it around my head for hours and can't figure it out. Any help is greatly appreciated.
So after trying to figure out a way not to use an iterative process, I folded and did this:
=arrayformula(SUMIFS(INDIRECT("'"&$B$4&"'!F6:F100"),INDIRECT("'"&$B$4&"'!D6:D100"),$B$2,INDIRECT("'"&$B$4&"'!E6:E100"),E$27,INDIRECT("'"&$B$4&"'!A6:A100"),$A41)+
SUMIFS(INDIRECT("'"&$B$5&"'!F6:F100"),INDIRECT("'"&$B$5&"'!D6:D100"),$B$2,INDIRECT("'"&$B$5&"'!E6:E100"),E$27,INDIRECT("'"&$B$5&"'!A6:A100"),$A41)+
SUMIFS(INDIRECT("'"&$B$6&"'!F6:F100"),INDIRECT("'"&$B$6&"'!D6:D100"),$B$2,INDIRECT("'"&$B$6&"'!E6:E100"),E$27,INDIRECT("'"&$B$6&"'!A6:A100"),$A41)+
SUMIFS(INDIRECT("'"&$B$7&"'!F6:F100"),INDIRECT("'"&$B$7&"'!D6:D100"),$B$2,INDIRECT("'"&$B$7&"'!E6:E100"),E$27,INDIRECT("'"&$B$7&"'!A6:A100"),$A41)+
SUMIFS(INDIRECT("'"&$B$8&"'!F6:F100"),INDIRECT("'"&$B$8&"'!D6:D100"),$B$2,INDIRECT("'"&$B$8&"'!E6:E100"),E$27,INDIRECT("'"&$B$8&"'!A6:A100"),$A41)+
SUMIFS(INDIRECT("'"&$B$9&"'!F6:F100"),INDIRECT("'"&$B$9&"'!D6:D100"),$B$2,INDIRECT("'"&$B$9&"'!E6:E100"),E$27,INDIRECT("'"&$B$9&"'!A6:A100"),$A41))
This formula allows me to cut and paste it to various cells easily, and does the job I need it to, while still using the indirect reference so I can change names without breaking the formula (granted I change the worksheet name as well).
I will need to edit this to include all possible worksheet amounts I can forsee, but once it's done, I won't have to tinker with names anymore.
I'm not happy with this answer, as it creates a really long and ugly formula, essentially repeating the same formula 20 times, but it does work. I feel like there should be an easy function that would be able to do this.
This will return Total sales:
=if(isna(ArrayFormula(QUERY({Lo!$A$5:$F; Tulio!$A$5:$F;Ya!$A$5:$F; Miguel!$A$5:$F;Kevin!$A$5:$F; Octo!$A$5:$F}, "select sum(Col6) where Col1=date '"&TEXT(A28,"yyyy-mm-dd")&"' label sum(Col6) ''",0)))=TRUE,0,ArrayFormula(QUERY({Lo!$A$5:$F; Tulio!$A$5:$F;Ya!$A$5:$F; Miguel!$A$5:$F;Kevin!$A$5:$F; Octo!$A$5:$F}, "select sum(Col6) where Col1=date '"&TEXT(A28,"yyyy-mm-dd")&"' label sum(Col6) ''",0)))
BTW, I get Total sales of $0, $615.50 and $2,498.00
The best way to pull data from a lot of unknown tab names without a script is to actually CREATE the tab names beforehand. On your sheet it looks like you're anticipating/making space for 21 employees. If I were you, I would just create 15 more tabs named Temp7,Temp8,Temp9... etc. Then you can just "hide" those tabs. Then a formula can be built in your totals section that will easily stack all the tabs up using an array literal and a QUERY( { } ) to add up the totals for you without all this INDIRECT() nonsense that you have been going through to pull from the individual tab names.
Would pre-adding tab names be something you were interested in if I could show you the formulas to make the totals easy to calculate?

Resources