I have a list of URLs that I would like properly ordered under their root domain headings.
The row data is currently scrambled with URLs under the wrong domain names as well. Here’s the example sheet.
Is there a formula that can fix all this?
I found a solution. It's not the most elegant as it requires copies of formula in all cells, but it works for all the column with domain names. As it reads domain name, it can't recognize nothing from "other" category
=ifna(query(flatten($B$6:$G$7),"select * where Col1 like '%"&lower($A11)&"%' and Col1 like '%"&lower(B$10)&"%'"))
Related
I am trying to bring in my list of employees from another file and have them sorted when they come in. When I do this:
=QUERY(importrange(K1, "Employees"), "Select *", 1)
Everything works great, but as soon as I add the order by method,
=QUERY(importrange(K1, "Employees"), "Select * order by Col4", 1)
It no longer works and just shows the header. Col4 is the correct column and if I use "Select Col4" all of the correct data shows up once again. Any idea of why this is happening?
Try putting your IMPORTRANGE() function in curly brackets. I was able to reproduce (what I believe to be) a similar error in my sheet.
When I defined a range to query, it would not work when using "Col4". This did work when I used D, though.
However, when I then placed the range into curly brackets, it understood Col4, and was able to order it.
Given that you did not get an error and instead got no values, make sure that the values in the column you are sorting by are of one majority datatype.
For example:
In this, the majority of column 4 are numbers, so when the data is sorted all the letters are left out.
My best advice is to simply check your datatypes. Dissimilar types won't sort properly with QUERY.
Make sure the formatting of the source data is not mixed.
Example: Text, Number, ...
Format the columns in the same format to the last row.
I've been struggling on something that looked simple at first, but that I can actually not solve on my own.
I have a list of items (column A), and each item has a quantity (column B). It is possible to find the same item multiple times in the list, with a different quantity. I would like to create, from that list, a list that references the unique occurrences with their total quantity throughout the whole initial list. I took a screenshot of the expected result, you can see it below (I cannot embed images yet, so I used an imgur link instead) :
Example
I've tried the UNIQUE & SORT combination which indeed gives me the sorted list of unique occurrences, however I didn't manage to add up their values. I feel like I'm going the wrong way here.
Thanks in advance for your help!
You problem can be solved easily by magic sumifs function, you can even have multiple criteria if you need:
=SUMIFS(B:B,A:A,D2)
use:
=QUERY({A3:B}; "select Col1,sum(Col2) where Col1 is not null group by Col1 label sum(Col2)''")
(I apologize if this was answered somewhere else so if it was please share with me because I couldn't find anything)
I have two sheets, one with a long two-column list - first column: city, second column: office
I can't give away the details due to my job's privacy concerns but it is just to group certain cities with certain "offices" and I figured the easiest way to do this would just simply type the office name next to the city all the way down so I could use =lookup()
I have a dropdown list that references the range of cities on the next sheet (so all values match exactly as it is) and the cell next to it will populate the office name associated in the next column to the city name.
=LOOKUP(B2, Sheet2!A2:A, Sheet2!B2:B)
B2 being the cell with the dropdown list, Sheet2!A2:A being the list of cities and Sheet2!B2:B being the list of offices
There are no duplicates in the city list, I have removed them. Though currently, there is only one office type I have included on this sheet for now until I get this working.
Some dropdown items display the office name just fine, others (just random ones) display an error. I don't really understand since they're all in the same place.
I made a copy and moved it to my personal drive so you can look at it directly
https://docs.google.com/spreadsheets/d/1TF1bBQdC8ysA30YcGOmB1ojrvQGnfGrznWOrA1vzHZs/edit?usp=sharing
Thank you for any advice, I'm probably missing something simple or there is a better way to do this.
*update: there was really no point in editing this post but thanks?
use VLOOKUP instead of LOOKUP
=VLOOKUP(B2, Sheet2!A2:B, 2, 0)
if you have more cities you can use arrayformula:
=ARRAYFORMULA(IFERROR(VLOOKUP(B2:B, Sheet2!A2:B, 2, 0)))
Your lookup is not working because the search range is not sorted.
The documentation for LOOKUP has a note:
The LOOKUP function will only work properly if data in search_range or
search_result_array is sorted. Use VLOOKUP, HLOOKUP, or other related
functions if data is not sorted.
You can sort the cities in "Sheet 2", or you can use VLOOKUP instead since it supports unsorted ranges:
=VLOOKUP(B2, Sheet2!A:B, 2, FALSE)
I have a spreadsheet having a column of names. Now, in another sheet I want to have the surnames from the aforementioned column to be displayed in a dropdown. How can I do this?
The names look like this:
Surname, FirstName
And there are also people from the same household having the same surnames. There are no people with the same surname that belong to different households. So I kind of want to get the surnames to identify that household.
You can create a single array formula referencing that list of names, that only pulls the surname portion using regexextract like this:
=IFERROR(UNIQUE(ARRAYFORMULA(REGEXEXTRACT(A:A,"^(.*),"))))
To explain, the regexextract, I feel is a lighter formula and slightly simpler than using a split function for two reasons:
A split function would require you put both names to two separate cells, and unfortunately split function does not work with arrayformula.
But since regex does - the regex I specified is basically saying grab any text (.*) from the beginning of the cell ^ up until that comma ,.
I then wrap the whole function in unique, so you dont have to deal with a ton of duplicates in your dropdown.
Following that I used Data Validation to point to the range of these unique surnames.
And just for fun at the end I finalized it with a FILTER function that would populate all the corresponding cells based on the surname chosen from the dropdown using this formula:
=FILTER(A:A,REGEXMATCH(A:A,C1)=TRUE)
To wrap all this information up, here is a sample image of what it looks like in the end:
I guess you have to split the names into another column. Let's say your names column is in A1, set the following formula in B1 and copy it in the next cells of the B row :
=SPLIT(A1;",")
Then, you can define your dropdown list in another sheet as explained here : https://support.google.com/docs/answer/186103
I need to match two conditions on the cell Name and add the price information into cell price if both condition match. In other words, if Name contains both conditions, get the price. I tried different approaches using QUERY, SEARCH; FIND; VLOOKUP but I got stuck somewhere in the middle. Here's the example sheet (Google Spreadsheet solution preferred over Excel):
https://docs.google.com/spreadsheets/d/1zwG3_5Ctg_IZ1kI04Uee-qIvMrNQ4GmEwySmYcMKLfA/edit?usp=sharing
Maybe important: Both, the Name values as well as the whole reference table get pulled from other files dynamically. So I don't know anything concerning order or length of these columns in advance, not even if there are matches at all.
In addition to previous answer AND given the current set of data (in a Google spreadsheet), in B2 try:
=ArrayFormula(iferror(vlookup(regexreplace(A2:A; "[^A-Z]"; ""); {E2:E&F2:F\G2:G}; 2; 0)))
and see if that works ?
Based on your spreadsheet table:
you can try the following formula:
this formula works in excel not in google spreadsheets
=IFNA(INDEX($G$2:$G$6;MATCH(1;COUNTIFS(A2;"*"&$E$2:$E$100&"*";A2;"*"&$F$2:$F$100&"*");0));"NOT FOUND")
this is an array formula, so press ctrl+shift+enter to calculate the formula.
i think it will do the job.
here is the example file to download