Best approach to problem, is VLOOKUP correct? - google-sheets

Good Afternoon,
I am looking for the best way to approach this task, I have 4 different shows and want to know which customer has been to each and likewise which has not.
Is vlookup with a nested IF the best approach?
For example, I want if to show Yes or No
Thank you!

maybe.
=INDEX(LAMBDA(x, IF(ISNUMBER(x)*(x>0), "yes", IF(x="", "no", x)))
(QUERY(A2:B, "select B,count(B) where B is not null group by B pivot A label B' '")))

Related

EXCEL/Google Sheets. Best way to SUM multiple VLOOKUP?

could you guys help me with a project. I was able to find a solution for my problem and the formula looks like this:
=IFERROR(VLOOKUP(E4;A8:B13;2;FALSE);0)+IFERROR(VLOOKUP(F4;A8:B13;2;FALSE);0)+IFERROR(VLOOKUP(G4;A8:B13;2;FALSE);0)
I have a category (e.g. Fruits) and need to import a sheet with different kind of fruits and non fruits. I use keywords which define what is a fruit and what not. I need to SUM all values which match to a keyword. My formula works but it will be more and more work when i need to add more keywords.
Are there a better way to realise this?
I build this example sheet for better understanding : )
Spreadsheet link
Thank you in advance : )
use:
=SUMPRODUCT(IFNA(VLOOKUP(E4:G4; A8:B13; 2; )))
you can even use E4:4 or E4:G5 or E4:5
row-wise it would be:
=INDEX(BYROW(E4:G5; LAMBDA(x; SUM(IFNA(VLOOKUP(x; A8:B13; 2; ))))))
use this
=ArrayFormula(SUM( IFERROR( VLOOKUP(E4:G4;A9:B;2;0))))
Usign sumif
=ArrayFormula(SUM(SUMIF(A9:A;"="&E4:G4;B9:B)))
Xlookup
=ArrayFormula(SUM(XLOOKUP(E4:G4;A9:A14;B9:B14;"";1)))
Us XLOOUP instead of IFERROR(VLOOKUP()) can shortens the formula.
=SUMPRODUCT(XLOOKUP($E4:4,$A$9:$A,$B$9:$B,0))

In Google Sheet, how do you use SUMIFS with OR logic matching a list of items?

In order to clarify the scenario, please check the example here:
https://docs.google.com/spreadsheets/d/1E_xyPvkTIObG5JA4UfG1EQa74cFEc9QiznidJ4HSmEY/edit?usp=sharing
What I want to do here is to:
filter by date (matching a certain date)
filter by product id (matching a list of specified ids)
sum up the total
I did try to find some ideas, though none of them worked, including the solution in the article below
https://exceljet.net/formula/sumifs-with-multiple-criteria-and-or-logic
Really appriciate if someone could point me in the right direction, thanks!
use:
=QUERY({'raw data'!A2:C},
"select Col1,sum(Col3)
where Col2 matches '"&TEXTJOIN("|", 1, 'ids to match'!A2:A)&"'
group by Col1
order by Col1 desc
label sum(Col3)''")
Sumifs is different than Sumif. You also have some text mixed with numbers. Your dates are text while Column b is numeric. Try this:
=Sumifs(C:C:,A:A,"2022-09-08",B:B,82267,B:B,82602) +
Sumifs(C:C:,A:A,"2022-09-08",B:B,82267,B:B,82602B:B,82604)
As Player() points out, if you have too many products to include, using sumifs would get pretty tedious and you ought to consider using a different function (i'd use filter). However since your question was Sumifs related, that's your answer.
To illustrate how this would work with something Filter, you could do this:
=sum(filter('raw data'!C:C,('raw data'!A:A=A2)*
(isnumber(match('raw data'!B:B,'ids to match'!A:A,0)))))

Combine Google Sheet Queries into one single Query?

I think this is a relatively straightforward question, but just don't know how to make it work. Is it possible to combine below two formulas into single query in one go?
=QUERY(A:E,"SELECT Max(C),Min(D),Sum(E)")
=QUERY(A:E,"SELECT B where DAY(A)<=3")
I tried something like these, but doesn't work
=QUERY(A:E,"SELECT B where DAY(A)<=3,Max(C),Min(D),Sum(E)") or
=QUERY(A:E,"SELECT B where DAY(A)<=3,SELECT Max(C),Min(D),Sum(E)")
Thank you!
Try below QUERY() function.
=QUERY(A:E,"SELECT B, Max(C), Min(D), Sum(E) where A is not null and DAY(A)<=3 group by B")

Search a range and bring back a stacked column of results

I know this is possible using a combination of probably =FILTER, ARRAYFORMULA and probably QUERY but hopefully, the examples will explain it better than words can.
Effectively, I have an output (the top table) and I want the formula that will bring back the dates each person has a mismatch (bottom table)
I hope that's clear enough.
try:
=ARRAYFORMULA(QUERY({A2:A10, TRIM(SPLIT(TRANSPOSE(QUERY(TRANSPOSE(
IF(B2:G10="mismatch", B1:G1, )),,999^99)), " "))}, "where Col2 is not null", ))

How would I conditionally format a cell based on conditions being true in the sheet?

I choose to edit the problem instead of having it spread out in the comments section.
"List of Invaders" - The names here, I want to be automatically crossed out when certain conditions are met. These conditions are: When all of the corresponding "invader" names are marked as "complete" with a "1" instead of the "0" in the corresponding "Completed" and "Crafted" columns. The light blue columns are where the names are "hidden" for the formulas to get info from.
So far, the marked answer was working for the initial intention, the problem arose when I wanted to add more columns for the array and or formula to look at.
I added a text box to the spreadsheet to explain what it is that should happen.
Link to the spreadsheet: https://docs.google.com/spreadsheets/d/1P1Nbt8Ct8pem0AqHwjvroX96hHDkrXwqPUZqngGEdFE/edit?usp=sharing
You are free to edit this one for testing. It is just a copy.
Thanks for all the help so far! And I apologize if I am causing confusion as to what I want, I hope this new example helps clear it up.
=ARRAYFORMULA(IFERROR(REGEXEXTRACT(G3:3, JOIN("|", QUERY(VLOOKUP(
QUERY($E4:F, "select E where E is not null order by F"),
QUERY($E4:F, "where E is not null order by F"), {1,2}, 0), "select Col1 where Col2=1")))))
=ARRAYFORMULA(IFERROR(REGEXEXTRACT(G3:3, JOIN("|", QUERY($E4:F, "select E where F=1")))))
Another way to do this without an array formula would be
=AND(COUNTIF($E:$E,"="&G3)=SUMIF($E:$E,"="&G3,$F:$F),SUMIF($E:$E,"="&G$3,$F:$F)>0)
and apply it to the range G3:V3 which is all of your invaders listed.

Resources