Google Sheets: Parsing users who are Program Managers - google-sheets

I have a spreadsheet that is always updating with 50+ rows. I am trying to retrieve users who are Program Managers (PGM) by parsing text but I am having a hard time since the data is not consistent since it's filled out by 20+ users.
I googled "google sheet parse text" but it's giving me functions such as =SEARCH, =LENS, =LEFT which I cannot use since my data is not consistent. Are there any other options or am I out of luck and must parse my info manually? Thanks in advance.
Google Sheet Link Example

in C2 use:
=ARRAYFORMULA(IFERROR(REGEXEXTRACT(B2:B,"PGM:.*")))

You may try:
=byrow(B2:B,lambda(z,if(z="",,ifna(regexextract(z,"(PGM:.*)(?:\n|$)")))))
row 6 outcome is varying a bit

Related

Automating Aggregating Data in Google Sheets

I have 100+ rows that are updated daily and as of now I have to update my last column manually. In my last column "Key Results Aggerated" I have to manually copy and paste Key Results into single cells per employee. I spent hours trying to figure out a solution but I am unable to. I have tried using import range function and concatenate function but I am having a hard time automating it since users can always add/remove a new row for "Key Result" at any time of the day. Thanks in advance. 🙏
Pic: Raw Data
Pic: Results I am trying to achieve.
Google Spreadsheet Example
You may insert this in E1 and protect that row:
={"KEYS";MAP(A2:A,D2:D,LAMBDA(aval,dval,IF(aval="","", TEXTJOIN(CHAR(10),1,dval:INDEX(D:D,ROW(dval)+IFNA(XMATCH("*",INDEX(A:A,ROW(aval)+1):INDEX(A:A, ROWS(D:D))),ROWS(A:A))-1)))))}
Erase previously all the prior formulas in E. Let me know

How do I import multiple rows into a different tab in Google Sheets, based on whether they contain a keyword?

I have a database of blogs, all based around different business units (including information like headline, topic, progress, spokesperson, etc).
I'd like to create separate tabs into which I can automatically pull the rows for each business unit (i.e. containing the keyword for "Banking", or "Energy & Utilities", or "Retail" in a certain column).
Unfortunately, despite looking at some tutorials and examples, I haven't been able to find any VLOOKUP, IMPORTRANGE, or INDEX/MATCH (etc.) functions that can help.
Example:
I've created an example spreadsheet here: https://docs.google.com/spreadsheets/d/19lHTxLaAgtHz5wg0sLLVw1YSpEXvQycL2PUd6Grs4X0/edit?usp=sharing
I'd like to be able to search column C for every row which contains the keyword "Banking" and automatically import all of these rows into a separate tab, named 'Banking'. That formula could then be repurposed for different tabs for each Business Unit.
Is there a formula or solution that would let me do this?
Thank you!
I attempted VLOOKUP, XLOOKUP, INDEX/MATCH, QUERY(IMPORTRANGE) in a separate sheet, and other related functions, but was unable to repurpose these functions to work for my database. Most efforts resulted in error codes or an inability to parse (although I'm more than willing to admit I probably made a mistake).
In A1 of your Banking sheet use:
=FILTER('Master sheet'!A:E,'Master sheet'!C:C="Banking")
You can try either of these in your Banking tab:
=QUERY('Master sheet'!A:E,"WHERE C='Banking'",1)
OR
={'Master sheet'!A1:E1;FILTER('Master sheet'!A:E,'Master sheet'!C:C="Banking")}
OR
=LAMBDA(z,{chooserows(z,1);filter(z,choosecols(z,3)="Banking")})('Master sheet'!A:E)
=QUERY(IMPORTRANGE("19lHTxLaAgtHz5wg0sLLVw1YSpEXvQycL2PUd6Grs4X0","Master Sheet!A:E")," Select * where Col3 Contains 'Banking' ")
or
=QUERY(IMPORTRANGE("19lHTxLaAgtHz5wg0sLLVw1YSpEXvQycL2PUd6Grs4X0","Master Sheet!A:E")," Select * where Col3='Banking' ")

Google data studio - Use multiple datasheet with same data keys/headers

So I've been stuck in this for some days, tryed a lot of search terms but all of them seems to bring me the same answers and i really need this:
I have a demand to join two different company's datas from the same owner, all of them have the same data sources (excel data sheets from FB ADS).
So they all share the same (keys/headers), like this:
COMPANY(1)'S ADS DATA
COMPANY(2)'S ADS DATA
So this way I need to put then togheter without having to join both of then on excel every time and also give him some nice data manipulation power.
The results should be something like this
By now I was trying to join data from the two companys but I couldn't really figure out how to properly do this so far I've made some tests and tryed reading a couple of articles and google data studio's help files. The merging data function seems to mess everything.
As a result of this merge, GDS gives me this fields:
Shouldn't I see like only one field labeled as cnt and cmp? I've noticed that GDS creates not one, but two data fields. If I try adding all data I need as key the left sheet turns all "0s". What Am I doing wrong here?
I have read your descriptions. It seems that you are looking for a solution to append both tables instead of merging the tables.
Do note that the data blending in GDS is a left outer join.
Hence, instead of doing the blending in GDS, I'd suggest you to append both datasets in Google Sheet in a separate tab before importing to GDS for visualisation. (assuming you don't mind copy-pasting the data into the Google Sheet).
Here is the formula to append both datasets in Google Sheets:
= {QUERY(A!A1:D1000,"SELECT A,B,C,D WHERE A <> ''",1);QUERY(B!A2:D, "SELECT A,B,C,D WHERE A <> '' ")}
I've created some dummy data in this google sheets and appended the data using the formula provided , you may take a look to understand further.
If you are unclear on the difference between merge and append, you may take a look in the Google Sheet documentation as well.
On a side note, I've screencast the process of answering this question and posted on my youtube channel. You may take a look if needed. (Thanks for the question and inspiration you provided for the video)

Google Sheet: IMPORTXML from Yahoo Finance [duplicate]

This question already has answers here:
Scraping data to Google Sheets from a website that uses JavaScript
(2 answers)
Closed last month.
I'm trying to import current stock price from yahoo finance. I used a formula from some website and it partially work. I only know how to tell it to look for a specific query and it worked fine for some other data point I need but the price change query changes from
"Fw(500) Pstart(10px) Fz(24px) C($dataRed)"
to
"Fw(500) Pstart(10px) Fz(24px) C($dataGreen)"
depending if the price is up or down for the day.
How do I modify the formula I'm using below to use the "or" operator in this case? so that it will pull the price down whether the stock is up or down for the day. Thanks!
Formula I'm using:
=IMPORTXML("https://finance.yahoo.com/quote/IBM","//span[#class='Fw(500) Pstart(10px) Fz(24px) C($dataRed)']")
I noticed the other answers did not work for me (they may have worked in the past), so I decided to post this solution. Just put the ticker in cell A1 and one or both of the below formulas somewhere else.
Price:
=IFNA(VALUE(IMPORTXML("https://finance.yahoo.com/quote/" & A1, "//*[#class=""D(ib) Mend(20px)""]/span[1]")))
Change:
=IFNA(VALUE(REGEXEXTRACT(IMPORTXML("https://finance.yahoo.com/quote/" & A1,"//*[#class=""D(ib) Mend(20px)""]/span[2]"), "^.*?\s")))
Currently using googlefinance but find it does not update often enough even when updates set to every minute so currently testing if below will allow updates at least with an F5 press within the sheet
This brings in the price and other information (dated 2022/09/27)
=IMPORTXML("https://finance.yahoo.com/quote/SAVA/", "//*[#id=""quote-header-info""]/div[3]/div[1]/div[1]")
If you just want the price: =IFNA(VALUE(IMPORTXML("https://finance.yahoo.com/quote/" & $A1, "//*[#class=""D(ib) Mend(20px)""]/span[1]")))
You could use a more dynamic/generic xpath that doesnt require such specific paths such as this:
This one pulls in both the price and the change:
=ARRAY_CONSTRAIN(transpose(IMPORTXML("https://finance.yahoo.com/quote/IBM:,"//*[#class='Mt(6px)']//span")),1,2)
If you just want the price:
=trim(IMPORTXML("https://finance.yahoo.com/quote/IBM","//*[#class='Mt(6px)']//span"))
If you just want the change:
=IMPORTXML("https://finance.yahoo.com/quote/IBM","//*[#class='Mt(6px)']//span[2]")
Sadly Yahoo Finance changes the XML/HTML structure of its website quite often. The one that works for now is:
=IMPORTXML("https://finance.yahoo.com/quote/IBM/", "//*[#id=""quote-header-info""]/div[3]/div[1]/div/span[1]")
You may always open the HTML structure and use the developer tools to find and copy the X-path.
P.S.1. Though there seem to be a bug and the function can't retrieve data from URLs where there is a dot/point/period "." in the name.
P.S.2. The IMPORTHTML() function can't also fetch the latest price from Yahoo Finance because the information is neither in a table nor a list. You can try the scripts from this page and this page to list all the tables and lists.

How to transfer data from multiple columns into one (without sorting)

I'm using Google Forms to collect peoples' availability and then centralizing all that into a spreadsheet where scheduling is then done. Pretty easy.
The people are separated into various categories in the forms, so when their names are shown in the spreadsheet they get recorded into different columns (B:G).
What I'd like to do is enter a formula that will automatically transfer any names from B:G into the A cells, which is where the entire spreadsheet is matching names to populate where to schedule the people. Essentially, all the names should automatically be placed in the A column. Hopefully that makes sense.
Here's an example sheet that is identical to what I'm working with:
https://docs.google.com/spreadsheets/d/1bxjpyEBvrcb-7o3QKIuG-c5Yu6JFiu66h3huHt0kjM0/edit?usp=sharing
Any help is greatly appreciated.
Thanks very much!!!
Try this in A2 and copy down:
=iferror(JOIN("",B16:G16))

Resources