How to organize cells in different columns with Google Sheets - google-sheets

I have a sheet that looks like this. You'll notice the columns contain different social media links.
I would like for the sheet to look like this - with columns containing similar social media links.
Is there a way to automate this categorization? Here's the sheet if helpful, thanks.

If you can replace the cell values of Link 1 and Link 2 with the website name that you want in that column then you can use FILTER to get values that match your criteria.
If your data looks like this:
Then you can use the following formula in F3 provided you've labelled the headings appropriately (facebook, instagram etc)
=ArrayFormula(FILTER(TRANSPOSE(SPLIT(TEXTJOIN(" ", 1, $B$3:$C), " ")), SEARCH(F$2, TRANSPOSE(SPLIT(TEXTJOIN(" ", 1, $B$3:$C), " "))), SEARCH($E3, TRANSPOSE(SPLIT(TEXTJOIN(" ", 1, $B$3:$C), " ")))))

Don't know if this helps, but here's an option with a formula in one cell - E2. You can put this on another sheet if preferred:
=arrayformula(
{A2:C2;
query(
{
vlookup({sequence(counta(A3:A),1,1,2),sequence(counta(A3:A),1,1,2),sequence(counta(A3:A),2)},{sequence(counta(A3:A)*2),query({row(A3:A),A3:A,B3:B;row(A3:A),A3:A,C3:C},"where Col2 is not null order by Col2,Col3",0)},{2,3,4,4},0)
},"select Col2,Col3,Col4 order by Col1",0)
})
If you have more Link columns than just two, I can provide different code.

Related

Match lookup value with importHTML tables in Google Sheet

Asked this same question before and got the answer and it works fine too. This is how I want the answer in the formula I give.
Please read : Match lookup value with importHTML and combine tables in Soogle Sheet
#rockinfreakshow Thank You so much for this answer. Sir please answer me according to my formula.
---------------------------------------------------------------------------------------------------------------------------------
I want the answer in the same way, but I match the lookup value from another url link with them in the same way as the answer comes from the formula I show and I want the answer.
I have this formula. And I get the answer well. Which you will get with the result in the link of google sheet below.
1st URL : https://www.screener.in/screens/881782/rk-all-stocks/?limit=25&page=1
=arrayformula(
lambda(
baseUrl, pageStart, pageEnd,
query(
reduce(
importhtml(baseUrl & pageStart, "table"),
sequence(pageEnd - pageStart, 1, pageStart + 1),
lambda(
result, pageNumber,
{
result;
iferror(
importhtml(baseUrl & pageNumber, "table"),
iferror(sequence(1, 11) / 0)
)
}
)
),
"where Col1 is not null", 1
)
)(
"https://www.screener.in/screens/881782/rk-all-stocks/?limit=25&page=", 1, 57
)
)
Result Screenshot
2. And there is another table in which I want to match the lookup value of the first table and all the values of that table. Which I have tried. Within this google sheet and you can also try this google sheet.
2nd URL with match 1st URL Record : https://www.screener.in/screens/881791/rk-holding/?page=1
=BYROW(B2:B,LAMBDA(bx,IF(bx="",,IFNA(QUERY(IMPORTHTML("https://www.screener.in/screens/881791/rk-holding/?page=1", "table",1),"Select Col12, Col13 Where Col2='"&bx&"'",0)))))
If I use this formula I get only 25 data.
Result Screenshot
If I use this formula I get only 1 page of data. As this url link has more than 165 pages.
i expected result
I only get as much data as in the first formula. Next to them i.e next to ROCE you need column number 12 and 13 from another URL link. Lookup values match and look for the data next to them. Lookup value column number will be 2. Which I have tried in this google sheet and you can also try.
try this in google sheet : OPEN GOOGLE SHEET
Thanks
Updated the solution in your sheet here

Display COLUMN number for TRUE in rank preference list in Google Sheets

I would like the option to toggle the display of compiled rank order responses in a grid between "response indicated" and "response indicated by rank number". I'm hoping for a formula solution rather than using Apps Script.
The included screenshot displays the current and desired outcome—with current as the example for "response indicated" (link to sheet below).
The grid pulls from responses on a separate sheet as shown in the included screenshot.
NOTE:
While the choice order on the input sheet is ordered 1-5, the display grid does not list the options in sort order.
There is a sort checkbox on map!C2 that informs whether the display grid uses the same order as input or sorts alphabetically.
The display grid uses separate formulas (B4 & C4—that do not reference one another) to populate.
The closest I've been able to generate is the first row toggling to the accurate ranking (using various combinations of QUERY, VLOOKUP, INDEX, MATCH, COLUMN)—but unable to generate an array output so that each row can create a specific response.
current C1 formula (uses named ranges):
=ArrayFormula(
IF(
REGEXMATCH(
IF(autoSort,
TRANSPOSE(QUERY(
TRANSPOSE(QUERY(
QUERY(inputTable,"where A is not null order by A",0),
"select "&ARRAYFORMULA(JOIN(",","Col"&SEQUENCE(1,5,2))),)),,
COLUMNS(QUERY(
QUERY(inputTable,"where A is not null order by A",0),
"select "&ARRAYFORMULA(JOIN(",","Col"&SEQUENCE(1,5,2))),)))),
TRANSPOSE(QUERY(
TRANSPOSE(QUERY(
QUERY(inputTable,"where A is not null",0),
"select "&ARRAYFORMULA(JOIN(",","Col"&SEQUENCE(1,5,2))),)),,
COLUMNS(QUERY(
QUERY(inputTable,"where A is not null",0),
"select "&ARRAYFORMULA(JOIN(",","Col"&SEQUENCE(1,5,2))),))))),
autoOptions),
CHAR(10003),))
link to example sheet: https://docs.google.com/spreadsheets/d/1eRaRf-0n-VQ2zljqUpk38sMrFlCh19JAcv7IFMeFMw0/edit?usp=sharing
just a MattKing's mod with a checkmark switch:
=INDEX(IFNA(VLOOKUP(B4:B&C3:K3,
SPLIT(FLATTEN(input!A2:A&input!B2:F&"|"&COLUMN(input!B1:F1)-1&"|"&CHAR(10003)), "|"),
IF(C1=TRUE, 3, 2), )))
This should do it:
=ARRAYFORMULA(IFERROR(VLOOKUP(B4:B&C3:K3,SPLIT(FLATTEN(input!A2:A&input!B2:F&"|"&COLUMN(input!B1:F1)-1),"|",0,0),2,0)))

Textjoin or Concatenate for this case?

hope you have a good day/evening.
Due to I always seems to use importrange function to import multiple sheets. I want to have a quicker way to replace the date (highlighted in red as per the screenshot) with the date referenced in Col A. This is my Google Sheet under the tab name "TextJoin" Google Sheets Link
try:
=INDEX({""; "={"&TEXTJOIN("; ", 1,
"IMPORTRANGE(""13DWtP4L7swqBgK6BGLeA-o_FfyD-D8-Ru30cOPf0I10"", """&
FILTER(TO_TEXT(A2:A)&"!A2:C"")", A2:A<>""))&"}"})
but you may need to wrap it into query and remove empty rows perhaps like:
=INDEX({""; "=QUERY({"&TEXTJOIN("; ", 1,
"IMPORTRANGE(""13DWtP4L7swqBgK6BGLeA-o_FfyD-D8-Ru30cOPf0I10"", """&
FILTER(TO_TEXT(A2:A)&"!A2:C"")", A2:A<>""))&"}, ""where Col1 is not null"", )"})
Try
=importrange("_____","'" & text(A2,"M/d/yy") &"'!A2:C")

Google Sheets Query Search Box | Search criteria

so basically I have a searchbox in my sheet that searches and pulls up data. For a reference see this image: https://i.imgur.com/MVTUCSw.png. So basically in cell A4 I put the data that I am looking for, but my formula restricts me to only looking up stuff in 1 row. For example, data starting with the word MELD, but I would like to be able to also look up data based on for example the someone their name.
The formula I use for the searchbox: =QUERY({'Pallets & Locaties'!A2:G;Voorraadverschillen!A2:G}, "SELECT * WHERE Col1 "&Opzoeken!B4&" '"&A4&"'")
The data that I want to be able to look up is stored in 2 sheets: Pallets & Locaties - https://i.imgur.com/qV7h2tz.png and in Voorraadverschillen - https://i.imgur.com/foqLkKa.png.
The searchbox is only able to lookup data in row, but I just want to be able to search for any kind of stored data in any of the sheets.
Here is my sheet for reference: https://docs.google.com/spreadsheets/d/10wmnxV16JUiD_b_54abkiLPwTqLITWRcUw3gsqvXoBE/edit?usp=sharing
I'd recommend you add more rows for the lookup criteria and add a column for what column it would search for.
Sheet modification:
Formula:
=QUERY({'Pallets & Locaties'!A2:G;Voorraadverschillen!A2:G}, "SELECT * WHERE "&TEXTJOIN(" AND ", TRUE, ARRAYFORMULA(IF(ISBLANK(A4:A10), "", A4:A10&" "&B4:B10&" '"&C4:C10&"'"))))
Test Sheet
Note:
The above formula will allow you to search on other columns with their own words and criteria to search.
Only rows with Kolom values will be included in the criteria. If you only need Col1 criteria, make sure to leave other rows blank.
This does use an AND search, meaning all of the criteria should be true and match the row. Feel free to use OR in the TEXTJOIN function if you only want to search all rows matching any of the criteria.
This will only search on sheets Pallets & Locaties and Voorraadverschillen. Add the necessary sheets if you need them.
EDIT:
Cleaned up the formula to not be so repetitive.
=IF(A4<>"",(QUERY({'Pallets & Locaties'!A2:G;Voorraadverschillen!A2:G},"Select * WHERE "&textjoin(" OR ", true, arrayformula("Col"&ROW(1:7)&" "&B4&" '"&A4&"'")))),(QUERY({'Pallets & Locaties'!A2:G;Voorraadverschillen!A2:G},"Select * WHERE Col1 IS NOT NULL")))
This searches every column for the data, as long as data is not identical in two columns you won't have issues. An example would be the search criteria "MELD" being in both Column A and B. If that were the case, only the results from the first matching column would populate.

Extract all partial matches: AGGREGRATE FORMULA TO replicate in GOOGLE SHEET

I need help on replicating below formula into Google sheet. Since google sheet does not support Aggregate, I am having difficulties replicating it into google sheet.
I need a formula which will list out all partial match item based on specific text from data.
Help is much appreciated.
Below is the formula I am using in excel:
=IFERROR(IF(F5>$D$9,"",INDEX($B$5:$B$16,AGGREGATE(15,6,(ROW($B$5:$B$16)-ROW($B$5)+1)/ISNUMBER(SEARCH($D$5,$B$5:$B$16)),F5)))," ")
and below is sample data and result outcome:
use in F2:
=QUERY(A2:A; "select A where A contains '"&C2&"' limit "&C6; 0)
or case insensitive:
=QUERY(A2:A; "select A where lower(A) contains '"&LOWER(C2)&"' limit "&C6; 0)

Resources