Add email address to sheet once Google form is submitted - if-statement

I have a google form where the user can choose 1 of 5 options, "Red" "Green" "Blue" "Violet" "Yellow"
I want to be able to add an email address to a column when a form is submitted so that I can set up an easy mail merge.
For example
David wanting 2 boxes from the blue team.
The "color -team" Name always comes in column "C". I want their group email to auto populate in Column "G" based on column > C3 would be "Blue"
Then G3 would become "blueteam#gmail.com"
I am thinking this would be done with an array formula and the if-then sort of idea?
Any help or directions would be greatly appreciated.

depends on how your form looks like if like this then use:
=ARRAYFORMULA(IF(A:A<>"",
TRIM(TRANSPOSE(QUERY(TRANSPOSE(B:F),,999^99)))&"team#gmail.com", ))
or perhaps:
={"emails"; ARRAYFORMULA(IF(A2:A<>"", REGEXREPLACE(
TRIM(TRANSPOSE(QUERY(TRANSPOSE(IF(B2:F>0, B1:F1, )),,999^99)))&
"team#gmail.com", "^team#gmail.com", ), ))}
UPDATE:
=ARRAYFORMULA(IFNA(VLOOKUP(C3:C, {
"Blue", "BlueC_S-group#ucsc.edu";
"Green", "abc#gmail.com";
"Yellow", "yellow#xxx.xx"}, 2, 0)))

Related

need to change background color with DAX measure - Not duplicate

I am new to Power BI just started my IT career. how do I solve this problem, its not a duplicate question.
Note: I have already got the required output using conditional formatting, but I have been asked to do the same by creating DAX measure for the report to the change the background color
This is my input data:
Here are the predefined conditions I need in my DAX query.
If Type1 >=0, <=2 and then Yellow
If Type1 >=3, <=5 and then Blue
If Type1 >=5, <=20 and then Orange
Lookup column is "Column 2"
This is the expected output:
This is what I have tried:
Measure 2 =
VAR q =
SELECTEDVALUE('Table 1'[1/1/2021])
Return
SWITCH(
True(),
q<=2 "Yellow",
q>=3,q<=4 "Blue"
q>=5,Q<=20 "Orange"
)
But its not working and I have also tried the same above logic using IF statement that did not work either.
Try changing your SWITCH statement to this:
SWITCH(
TRUE(),
q<=2, "Yellow",
q>=3 && q<=4, "Blue",
q>=5 && q<=20, "Orange"
)
It worked for me.

vlookup google sheets first and last name compare

Okay so i have a this formula:
=ArrayFormula({"Manager:";IF(D5:D="",,IFERROR(VLOOKUP("*"&REGEXEXTRACT(D5:D,"[a-zA-Z]+")&"*",'Client-Manager'!A:B,2,FALSE),"NO MATCH"))})
It works fine with what i have it doing now but i'm running into a problem now were i need to compare both last and first name and i can't figure out how to do it.
Here is an example sheet:
Sheet im working with
Im comparing in "work-order" sheet column D with and in "manager" sheet column A to then output back on "work-order" sheet column G.
Formula i'm working with resides in "Manager" cell in "work-order" sheet in column G
try:
=ARRAYFORMULA({"Manager:"; IF(D5:D="",,
IFERROR(VLOOKUP("*"&REGEXEXTRACT(REGEXREPLACE(D5:D, ",", ),
"[a-zA-Z ]+")&"*", 'Client-Manager'!A:B, 2, ),
IFERROR(VLOOKUP("*"&REGEXEXTRACT(D5:D,
"[a-zA-Z]+")&"*", 'Client-Manager'!A:B, 2, ), "NO MATCH")))})

Change value of a cell depending on contents of column of another google sheet

I have a Google sheet with information on it and I am trying to automate it a bit. I need a formula which changes a cell value to Yes if there are specific strings in the column of another sheet. I have tried a couple different things using IF and importrange but it's just not working.
I have created a sample sheet to show what I am trying to do:
Test Sheet 1
Test Sheet 2
I would like column C of Sheet 1 to change to Yes if Columns 1 and 2 of both sheets match and Column C of Sheet 2 contains "Reloaded" or "Yes".
try:
=ARRAYFORMULA(IF(REGEXMATCH(VLOOKUP(A2:A&B2:B, {
IMPORTRANGE("1YMBUYC6JgQke-2YWs_VZx9zqlmOdhV8WYvhTpTVxBYM", "Sheet1!A2:A")&
IMPORTRANGE("1YMBUYC6JgQke-2YWs_VZx9zqlmOdhV8WYvhTpTVxBYM", "Sheet1!B2:B"),
IMPORTRANGE("1YMBUYC6JgQke-2YWs_VZx9zqlmOdhV8WYvhTpTVxBYM", "Sheet1!C2:C")}, 2, 0),
"Yes|Reloaded")=TRUE, "Yes", ))
UPDATE:
=ARRAYFORMULA(IFERROR(IF((D2:D="User Task")*(REGEXMATCH(VLOOKUP(B2:B, {
IMPORTRANGE("1YMBUYC6JgQke-2YWs_VZx9zqlmOdhV8WYvhTpTVxBYM", "Sheet1!B2:B"),
IMPORTRANGE("1YMBUYC6JgQke-2YWs_VZx9zqlmOdhV8WYvhTpTVxBYM", "Sheet1!C2:C")}, 2, 0),
"Yes|Reloaded")=TRUE), "Yes", )))
Here you go:
={
"Complete";
ARRAYFORMULA(
IF(
(IMPORTRANGE("1YMBUYC6JgQke-2YWs_VZx9zqlmOdhV8WYvhTpTVxBYM", "Sheet1!A2:A") = A2:A)
* (IMPORTRANGE("1YMBUYC6JgQke-2YWs_VZx9zqlmOdhV8WYvhTpTVxBYM", "Sheet1!B2:B") = B2:B)
* (REGEXMATCH(IMPORTRANGE("1YMBUYC6JgQke-2YWs_VZx9zqlmOdhV8WYvhTpTVxBYM", "Sheet1!C2:C"), "Reloaded|Yes")),
"Yes",
""
)
)
}

How to get a specific value from a Cell which has a lot of data

I want to get only the price's encased in brackets in Price EUR cell:
Sheet link: https://docs.google.com/spreadsheets/d/1xoNPfIfrVv7jF8W3Pa67Iu9oJRz2NOncW7oLQ94mWQ4
try:
=IFNA(INDEX(TRIM(ARRAY_CONSTRAIN(SUBSTITUTE(
SPLIT(REGEXEXTRACT($A3, B1&"(.+)"), "]"), "[", ), 1, 2))), 0)

Python 2: How do I pull a value from a matrix of options based on multiple test values?

Let's say I have two colors of blocks, red and blue. Let's also say that blocks have a number on them (regardless of color, and numbers can be repeated). So we could have the following blocks:
block_one = {"color": "red", "value": 1}
block_two = {"color": "red", "value": 3}
block_three = {"color": "blue", "value": 1}
I have the following table of prices:
Red Blue
1 10 15
2 20 17
3 30 19
What is an efficient way for me to figure out the price based on the two pieces of data I have for each block?
Example: What is the price of block_one, and I want an output of 10.
I've been writing nests of if-elif testing multiple dictionaries of prices, but it is 1.) convoluted and ugly and 2.) slow.