GoogleSheets =VLOOKUP, =SUM - google-sheets

I am trying to copy some information from another sheet and sum them with different multipliers. This code roughly works:
=VLOOKUP(D8,Market!A:K,11,FALSE)+VLOOKUP(E8,Market!A:K,11,FALSE)*2+VLOOKUP(F8,Market!A:K,11,FALSE)*3+VLOOKUP(G8,Market!A:K,11,FALSE)
I am sure there must be a shorter way to do this - what is it?

It's not shorter but an alternative approach might be:
=MMULT({1,2,3,1},{VLOOKUP(D8,Market!A:K,11,0);VLOOKUP(E8,Market!A:K,11,0);VLOOKUP(F8,Market!A:K,11,0);VLOOKUP(G8,Market!A:K,11,0)})

Related

Simpler Substitute Solution From Range In Column Within Formula W/ Other Parameters

Thanks ahead of time for any ideas!
I have a formula I'm utilizing to trim down on selection of words I'd like to eliminate from an output using SUBSTITUTE:
=ArrayFormula(sort(unique(trim(lower(substitute(substitute(substitute(substitute(substitute(substitute(substitute(substitute(substitute(flatten(split(B:B," ")),A2,""),A3,""),A4,""),A5,""),A6,""),A7,""),A8,""),A9,""),A10,""))))))
As I go through my process, the words for substitution grows, leading to the necessity of adding yet another substitute to my formula.
If there's any other ingenious way of not having to do this, but rather consider any word in Column A for substitution, that'd be optimal.
Here's some sample data; and please don't hesitate with any questions, or thoughts:
20230202 stack exchange substitute better solution question
Here's another way:
=SORT(LAMBDA(words,UNIQUE(FILTER(words,NOT(COUNTIF(A2:A,words)))))(FLATTEN(IFERROR(SPLIT(B2:B," ")))))
Try QUERY() formula with few others functions.
=QUERY(UNIQUE(FLATTEN(INDEX(SPLIT(B2:INDEX(B2:B,COUNTA(B2:B))," ")))),
"where not Col1 matches '" & TEXTJOIN("|",1,A2:INDEX(A2:A,COUNTA(A2:A))) & "|^$' order by Col1",0)

How to use Lambda so the if statement is it's own test condition without rewriting if statement in google sheets

This is a general question based not on specific formula - but I couldn't find an answer to it anywhere - but it seems like it should be possible.
In this screenshot, you, Y and X are the same for the sake of example (there is a slight difference, but for example's sake - let's assume it's the same).
In the formula, the same formula is used in an if statement to determine if we should move forward with actually calculating the formula. Is there a way to use lambda not to repeat the formula?
yes you may condense it to something in the sorts of:
=lambda(X,if(X>0,X,0))(*FORMULA*)
a generalized example in the screenshot:

Export specific numbers from Sheets

So i have this column of numbers and i wish to extract only the numbers before the "HE" text for example, this is what i need, and i don't really know how to achieve this.
Maybe there is a way to use a formula or command to do this, i've been trying to use power tools add-on but to no avail i did not get it.
Maybe for clarification in each cell there are 2 lines, using alt+enter.
REGEXEXTRACT() is suitable in this case.
=REGEXEXTRACT(A1,"(.+) HE")
Few good tips here about REGEXEXTRACT().
For array approach use below formula-
=ArrayFormula(IF(A1:A="","",REGEXEXTRACT(A1:A,"(.+) HE")))

=LEN Function in Google Sheet not working corretly

I have a column with lots of rows containing text. I want to highlight cells with over an x-amount of characters, but how? The code I'm using in combination with 'Conditional Formatting' is not working all the time. Sometimes it highlights text over the x amount and sometimes it doesn't, so there is something I'm doing wrong here. The x-amount in the example below is: 300.
you may also need to lock it like:
=LEN(E$1:E$170)>300
Silly me... I found the answer myself. I need to put in the same range in the formula as well. Formula with the range E1:E170 needs to be: =LEN(E1:E170)>300

Filter and logical operators

EZ stuff but after an hour.. =filter(May15!A:S , May15!E:E="Authorization") is yielding a rich populated sheet. However I can't get OR working! Despite it working elsewhere in the sheet. I'd like other possibilities via the same filter. I tried several including the OR this way
=filter(May15!A:S , OR(May15!E:E="Authorization" , May15!E:E="bigwhale", May15!E:E="hi"))
.. to no avail. Any help appreciated. Also, I read somewhere the OR could be accessed using a "+" and that sounded like a neat method.. Thanks!
One possible way is to use RegEx:
=filter(H:H , REGEXMATCH(E:E,JOIN("|",A1:A3)))
put in A1:A3:
Authorization
bigwhale
hi
This trick is useful when you need to add conditions, just paste one more value in cell A4 and use range A1:A4
Another way is to use plus sign:
=FILTER(H:H,(E:E="Authorization")+(E:E="bigwhale")+(E:E="hi"))

Resources