vlookup google sheets first and last name compare - regex

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")))})

Related

google sheets, splitting and stacking a paragraph

I have a 3 row by 2 column table
1Q18 hello. testing row one.
2Q18 There are about 7.5b people. That's alot.
3Q18 Last sentence. To be stacking.
I want to split each sentence then have a quarter label with it, out would be
1Q18 hello
1Q18 testing row one
2Q18 There are about 7.5b people
2Q18 That's alot
3Q18 Last sentence
3Q18 To be stacking
I can get one line to work with:
=TRANSPOSE({split(rept(A1&" ",counta(split(B1,".")))," ");split(B1,".")})
which would give me:
1Q18 hello
1Q18 testing row one
I need a formula that will let me go down 100 rows, so I can't manually repeat the formula 3 times and use {} with ;
I've also tried using the
=map(A1:A,B2:B,LAMBDA(x,y,TRANSPOSE({split(rept(x&" ",counta(split(y,".")))," ");split(y,".")})))
but get a
Error Result should be a single column.
try:
=INDEX(QUERY(SPLIT(FLATTEN(LAMBDA(x, IF(x="",,A1:A&"​"&x))
(SPLIT(B1:B&" ", ". ", ))), "​"), "where Col2 is not null", ))
Try below formula-
=QUERY(REDUCE(,B1:B3,LAMBDA(a,x,{a;TRANSPOSE(INDEX(INDEX(A1:A,ROW(x)) & " " & SPLIT(SUBSTITUTE(x,". ",".|"),"|")))})),"offset 1",0)
Here's another formula you can try:
=ARRAYFORMULA(
QUERY(
REDUCE({0,0},
QUERY(A1:A&"❄️"&SPLIT(B1:B,". ",),
"where Col1 <> '#VALUE!'"),
LAMBDA(a,c,
{a;SPLIT(c,"❄️",,)})),
"where Col2 is not null offset 1",))

vlookup between two worksheets in VBA

i have tried alot doing vlookup between two workbooks, one is open (book1) and the other
needs to be opened by GetOpenFilename() function let us call it (book2).
(book1) contains sheet1 where i want to do the vlookup
(book2) contains sheet2 where i want to match the id (column 1) and get the names (column2) by vlookup.
here is my code. Notice that the number of rows changes every month so, i need to loop until the last row in sheet1(in book1).
Sub status_first_Step()
Range("C:C").Insert
Set book1 = Sheets("Sheet1")
book2 = Application.GetOpenFilename()
Workbooks.Open book2
Set book2 = ActiveWorkbook
For i = 1 To Cells(Rows.Count, "A").End(xlUp).Row
ws1.Cells(i, "C").Value = Application.VLookup(book1.Cells(i, 1).Value, book2.Sheets("sheet2").Columns("A:Y"), 2, 0)
Next i
End Sub
Thank You.

Replace blanks with a string with DAX coding in Power BI

I have a data in Excel and I have uploaded in power bi, created a visualisation using a chart which looks like -
blank, CP, Jj10 are basically my y axis and dashes are my bars of horizontal chart. I have tried to show how my chart looks like because I don't get any other option
(Blank)-------------998
CP-----------56
Jj10--------44
0BN--------------77
Hi-po---2
Naas-------21
There is a column named performance (sheet_name=Empl_data) and what I want is to replace the blanks with Non-GT in power bi with creating a new column.
What my output should look like -
(Non-GT)-------------998
CP-----------56
Jj10--------44
0BN--------------77
Hi-po---2
Naas-------21
I have tried this -
Non-GT = IF(ISBLANK('Empl_data'[performance]),"Non-GT",'Empl_data'[performance])
What i get is
Non-GT----------------964
(Blank)-------------34
CP-----------56
Jj10--------44
0BN--------------77
Hi-po---2
Naas-------21
I just want to replace blanks with Non-TSG completely but still it shows blank. Please help me out to solve the problem and please let me know if I have made clear what my prblm is.
My data -
Empl_id
Empl_name
performance
99807
Somman paul
0076
Richards.M
8870
Maheen Josef.T
11209
Dojar Farah
6651
Macklegn Sagoe
Hi-po
551
Cada Farez
Jj10
12
Qwezy Goha
Hi-po
6567
Beheriop Produse
CP
2227
John semmers
0BN
656
Majeeio .f
80100
Drejju Yan
Is it actually Blank where it is showing nothing? First confirm there are spaces or really null in the data, then apply conditions as bellow-
Non-GT =
IF(
'Empl_data'[performance] = BLANK() || 'Empl_data'[performance] = "",
"Non-GT",
'Empl_data'[performance]
)
Q: Where you are transforming data with that condition? Power Query Editor? Or creating Measure or Calculated column?

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",
""
)
)
}

Show the row from a search result - Google Sheets

I am trying to make a search function that displays the entire row from matching entries.
This is what currently happens using: =IFERROR(IF(B3="","No Results",ARRAYFORMULA(FILTER(DOCS!C2:C, SEARCH(B3, DOCS!C2:C)))),"No Results")
And this is the column I am trying to show
Example
Data:
Fortnite,Video Game,Epic Games
PUBG,Video Game,IDK
Steam,Service,Valve
Amazon,Service,Amazon
Cats,Species,Animal Kingdom
Search Column B for "Service"
(MY CURRENT RESULTS):
Service
Service
(MY INTENDED RESULTS):
Steam,Service,Valve
Amazon,Service,Amazon
=IF(D1<>"", IFERROR(FILTER(A:A, REGEXMATCH(LOWER(A:A), LOWER(D1))), "No Results"), )
=FILTER(DOCS!A2:G, REGEXMATCH(LOWER(DOCS!C2:C), LOWER(J1)), DOCS!E2:E="active")