Where to place "IFERROR" and "SWITCH" in a formula - google-sheets

I'm working on a personal project, this is a continuation of this post here on reddit.
I'm struggling with the IFERROR and SWITCH functions. Why doesn't this formula work?
=AVERAGEIFS(J5:J,H5:H,A40,I5:I,A26(IFERROR(SWITCH(J5:J,"❤️",10,"💩",0),J5:J)))
Document
What I'm trying to do:
Make the average per platform and if it's a movie or a show and including the emojis as value. This is what I asked in my previous post.
One question I have is: How can I make the average for a platform including everyone if someone hasn't seen something on one platform?

Added formula to your sheet Cell B42
=AVERAGE(IFNA(FILTER(IFERROR(SWITCH(J5:J,"❤️",10,"💩",0),J5:J),H5:H=A40,I5:I=A42)))
Regarding your second query, I'd say to leave the person out maybe from the average score. his stat within the calculation cell would just be blank

Related

The subtraction from the number of each below of row on column AF. Get minus each others gradually row by row pointing upwards by formula in G.sheets

=byrow(AF3:AF;lambda(each;if(each="";"";SUMIFS(INDIRECT("AF"&row(each)&":AF");Indirect("O"&row(each)&":O");Indirect("O"&row(each));Indirect("K"&row(each)&":K");"CHECKOUT"))))
the formulas by #Martin!
From the above of the formulas by #Martin I try to modify a litle bit to ajustment to my kinda of my case I thought by trying to change the "SUMIFS" into "MINIFS" will comes out as I expected but well it's not. It's not working at all even close as I imagine it before. I was wrong because it's not for a MINUS function but in other hand it's like for another function to get a MINIMUM of number in a dataset.
What I want is to get a SUBTRACTION every each row of them SUBTRACT from the number of every below of each of them with the two conditions :
*first: based on the NAME on column "O".
*second: based on the criteria I desired and should be a certain value like CHECKOUT on column "K".
And I attached the link to explain more and than so you'll be understand what I mean is. And with the "expect output" in it hope can make this question more be clearly. Thanks in advance!
Please, feel free to edit My Example Quest of Spreadsheet
Isn't there anyway for you of differentiating that first values to be substracted from? (Or maybe eventually there would be more). For example putting "CHECKIN" to those values and "CHECKOUT" for all the ones that will diminish it. In that case you could modify that original formula and sum all the CHECKINs and substract from it all the CHECKOUTS
I've put it in a new tab of your spreadsheet, let me know if this could work for you:
=byrow(AF3:AF;lambda(each;if(each="";"";IF(OR(INDIRECT("K"&row(each))="CHECKIN";INDIRECT("K"&row(each))="CHECKOUT");sumifs(INDIRECT("AF"&row(each)&":AF");Indirect("O"&row(each)&":O");Indirect("O"&row(each));Indirect("K"&row(each)&":K");"CHECKIN")-sumifs(INDIRECT("AF"&row(each)&":AF");Indirect("O"&row(each)&":O");Indirect("O"&row(each));Indirect("K"&row(each)&":K");"CHECKOUT");""))))

Trying to COUNTIFS date = this week (sunday-saturday)?

I'm building a spreadsheet that automatically gets a row added when I get an application on my form. Here is the link to the sheet. As you can see, the first tab is just a list of applications, with the location they've applied for, and the date. The second tab is a daily count for each location, which is eventually sent out as an email each night. I'd like to include weekly numbers, and maybe even an ongoing weekly comparison. e.g. # of apps today, this week (so far), last week, etc.
I'm no expert with this stuff and it's getting a bit over my head possibly. Any ideas on how to get this done smoothly?? Thanks a ton in advance!
Your problem (like many) is primarily a problem with the organization of your raw data.
On a new tab called MK.Help, I've put the following formula in cell A2:
=ARRAYFORMULA(QUERY(SPLIT(FLATTEN(Applications!A2:A&"|"&Applications!S2:S&"|"&FLOOR(Applications!S2:S-2,7)+2&"|"&Applications!B2:R),"|",0,0),"where Col4 is not null and Col2>="&I2))
Then I made a simple table on the right with some fairly straightforward COUNTIFS() that look like this:
=COUNTIFS($C:$C,H$2,$D:$D,$F3)
The layout of the data vertically is what's making the formulas relatively simple for the summary.

How do I get a cell to retain text, after the cell it pulls from changes text?

This question will have two parts. If you're willing to help me out, feel free to address whichever chunk you've got the time or interest for. Thanks in advance.
Assume there are two cells in a spreadsheet, the first (A1) has the text hello inside, and the second (A2) has =T(A1), so they now both say hello. If I want to change the text in A1, but want the text in A2 to continue to read hello, is there a way to automate this?
For some context, this is part of a larger project where I want to create a column of stock tickers that I like. Ideally, I could type the ticker name into a cell, check a box if I want to track it, and it would automatically add itself to a column. Where the first part of this question becomes relevant is that I would then move on to another stock, deleting the first ticker I wrote, but still wanting it in my column.
The second part of the question is about making the column. My instinct would be to use the =ARRAYFORMULA function, but that draws from a column to begin with, so I'm a little bit stuck.
Thanks
answer for Q1:
no, not possible unless you hardcode A2 as:
=T("hello")
or you use a script to remember your value but in that case, the A2 will host a custom function instead of the formula you mentioned
ofc what you are mentioning with those tickers, checkboxes and moving values around it's completely doable with a script
answer for Q2:
it depends on the formulae you use. not all formulas are supported under ARRAYFORMULA

using sum and countifs to get a percentage of 'yes'es across multiple columns by month and team - is there a simpler way?

I've been asked to create a summary for some google form responses, and though I have a working solution, I can't help but feel there must be a more elegant one.
The form collects data related to case checking - every month each team (there's 100+ teams) has to check a certain number of cases based on how many staff are in their team, and enter the results for each case they've checked in the google form. The team that have set this up want me to summarise the data by team, month, and section of the form (preliminary questions, case recording, outcomes, etc). There are 8 sections on the live form, ranging from 1-13 questions, all with Yes/No/NA/blank answers.
(honestly, it's not how I'd have approached setting all this up, but that is out of my hands!)
So they're essentially looking for a live monthly summary with team names down the side, section names along the top, and a %age completed that will keep up with entries as they come in (where we can also use importrange and query to pull the relevant bits into other google sheet summaries, as and when needed).
What I've currently got is this:
=iferror(sum(countifs('Form Responses'!$B:$B,$A3,'Form
Responses'!$F:$F,"Yes",'Form Responses'!$E:$E,">="&$B$1,'Form
Responses'!$E:$E,"<"&edate($B$1,1)),countifs('Form
Responses'!$B:$B,$A3,'Form Responses'!$G:$G,"Yes",'Form
Responses'!$E:$E,">="&$B$1,'Form
Responses'!$E:$E,"<"&edate($B$1,1)),countifs('Form
Responses'!$B:$B,$A3,'Form Responses'!$H:$H,"Yes",'Form
Responses'!$E:$E,">="&$B$1,'Form
Responses'!$E:$E,"<"&edate($B$1,1)),countifs('Form
Responses'!$B:$B,$A3,'Form Responses'!$I:$I,"Yes",'Form
Responses'!$E:$E,">="&$B$1,'Form
Responses'!$E:$E,"<"&edate($B$1,1)),countifs('Form
Responses'!$B:$B,$A3,'Form Responses'!$J:$J,"Yes",'Form
Responses'!$E:$E,">="&$B$1,'Form
Responses'!$E:$E,"<"&edate($B$1,1)),countifs('Form
Responses'!$B:$B,$A3,'Form Responses'!$K:$K,"Yes",'Form
Responses'!$E:$E,">="&$B$1,'Form
Responses'!$E:$E,"<"&edate($B$1,1)))/(countifs('Form
Responses'!$B:$B,$A3,'Form Responses'!$E:$E,">="&$B$1,'Form
Responses'!$E:$E,"<"&edate($B$1,1))*6),0)
It works, but it feels like a bit of a brute-force-and-ignorance solution. I've tried countifs & array, I've looked a pivot but I can't get the section groups, I've had a play with query but I can't figure out how to ask it to count all Yeses in multiple columns at once.
Is there a more elegant solution, or do I have to resign myself to setting up the next financial year's summaries like this?
Edit:
You can use plain array boolean multiplication to achieve the count, as trues are converted to 1s and false are converted to 0s:
=TO_PERCENT(ARRAYFORMULA(
SUM((f!F1:K="Yes")*(f!E1:E>=B1)*(f!E1:E<EDATE(B1,1))*(f!B:B=A3))/
SUM(6*(f!E1:E>=B1)*(f!E1:E<EDATE(B1,1))*(f!B:B=A3))
)
)
Renamed Form Responses to f
Numerator: SUM of
Question filter (f!F:K =Yes) and
Month filter (f!E:E is within month of B1) and
Team filter(B:B = A3)
Denominator: 6 times the SUM of
Month filter (f!E:E is within month of B1) and
Team filter(B:B = A3)
On this sample sheet that you provided you'll notice two new tabs. MK.Retab and MK.Summary.
On MK.Retab is a single formula in A2 that "re-tabulates" all of your survey data into a format that is much easier to analyze going forward. That tab can be "hidden" on your real project. It will continue to build the 6 column dataset forever. It would be a sort of "back end" sheet, only used to supply data to any further downstream analysis.
On MK.Summary is a single formula in cell A1 that Query's that dataset from MK.Retab and shows the percentage of Yes's by month by section by team in a format similar to what you proposed. I coded it to display the most recent month at the left, immediately to the right of the team names, and to push historical data off to the right. Even though people are often used to seeing time go from left to right, I find that the opposite method nice because it keeps you from having to scroll sideways to see the most recent data. It is very simple to change should you want to by getting rid of the "desc" that you find in the "order by" clause of the query string.
I find this kind of two step solution to problems like your useful, because while the summary migth not be exactly what you want, it's always easier to build formulas and analyses off of the data as laid out in the MK.Retab sheet.
As for the formula in MK.Retab, it is based on a method that I came up with a while back that constructs a large vlookup where the [search key] is actually a sequence of decimal numbers that is built by counting the number of rows in your real data set and multiplying by the number of columns of data that need to be repeated for each row. I built a demo some time ago that I'm happy to share with folks if you want to understand better how it works.
You said that your goal was to understand the formulas so that you could modify them going forward as needed. I'm not sure how easy that will be to do, but I can try my best to answer any questions you might have about the method or the solution generally.
What I can tell you is that some of the formulas are more complicated than they need to be because you just used Q1 Q2 Q3 etc instead of the actual questions. if you had a list of the questions asked somewhere (on some other tab, say), and what you wanted to call/name their corresponding "sections", it would make the formula significantly less complicated. As it stands, I had to use the appearance of the word "Comments", in row 1 to distinguish between where one section ended and another section began. The upside to that decision though, is that the formula I wrote is infinitely expandable to the right. That is, if you were to add another 100 columns worth of questions and answers to the sample set here, the formula would be able to handle that and break it out, so long as there was the word "Comments" between each section.
Hope all this helps.

Google Sheets: How do I look up multiple values in another sheet?

The scenario I am faced with is kind of an odd one. Basically, I am designing a Google Sheet for work that will allow the employees to log their tech support phone calls and then a report will automatically update on another page, keeping a collective tally of sorts of all the activity on a particular day.
What I am trying to do is write a function that searches another sheet for a particular date and, if that date is found, sum a particular column of values for that day only. There are pictures attached that should help explain the problem.
Basically, I am trying to write a general equation in the cell reading "FALSE" that will look up the date of that row (in this case 1/1/2017) in the "Spendgo Minutes" sheet. If that date were to be found somewhere on that sheet (not necessarily at the top of the sheet), the "Minutes Gained" column would be summed up, but for that date only (not the entire column). Here is my running formula right now that has errors:
=IF(COUNTIF('Spendgo Tally'!$A$3:$A,$B7),'Spendgo Tally'!$G3)
Does anyone know how this might be possible? Feel free to ask any clarifying questions.
You're looking for SUMIF
= SUMIF('Spendgo Tally'!$A$3:$A,$B7,'Spendgo Tally'!$G3:$G)

Resources