Google Sheets - =ISURL() - google-sheets

In Google Sheets, I want check if a URL exists in the cell.
I do this with =ISURL(E1) which seems simple enough. I have this setup as a custom formula within Data Validation. The problem is, I want to do this for the entire column and I don't want to type =ISURL(E1), =ISURL(E2), =ISURL(E3), etc... for every single row. This rule is only applied to itself, so is there a way I can make the cell reference itself? For example =ISURL(SELF), then I can copy/paste this rule on the entire column?
I've tried the below but none work.
=ISURL()
=ISURL(E$1)
=ISURL(SELF)

Data validation has a condition Is Valid URL.
You do not need a custom formula.
Also,
=ISURL(E1)
Apply to range E1:E20
Works well for the whole range.

There's a build in function for that, you don't need to use a custom formula.
In the Data validation popup go to Criteria select Text and then is valid url.

Related

Trying to make comparison between different sheets of data in Google sheets using column pair values

I am trying to get to the point where my Google sheet is going to show up like the picture below.
Basically I am trying to find the common column in different table (sheet) and also make sure the type of the columns matches too. The columns are unsorted and won't be of equal length.
But I am unable to do so using vlookup or query which is becoming to complicated. I am attaching the link for the Google sheet.
https://docs.google.com/spreadsheets/d/1yk5J_R74yvYTOmOr5LHgMuLD--xT68pOaps8XvhOgy8/edit#gid=0
Try below formula-
=IFERROR(MAP(C7:C13,D7:D13, LAMBDA(x,y,IF(XLOOKUP(x,A7:A10,B7:B10)=y,"Match","Mismatch in Type"))),"No Match")
This should also work.
=INDEX(IFNA(XLOOKUP(--(VLOOKUP(C7:C13,A7:B10,2,0)=D7:D13),{0,1},{"Type Mismatch","Match"}),"No Match"))
This will spill results automatically. No need drag down.
Update: Use below formula as dynamic input range from source and target sheet without helper QUERY function.
=MAP(Target!A2:INDEX(Target!A2:A,COUNTA(Target!A2:A)),
LAMBDA(x,IFNA(XLOOKUP(XLOOKUP(x,Source!A2:A,Source!B2:B)=XLOOKUP(x,Target!A2:A,Target!B2:B),
{TRUE,FALSE},{"Match","Type Mismatch"}),"No MAtch")))
I think you have a typo in your Source table (you have 'emd_id' where you meant 'emp_id'). If you correct that, you can delete everything in F7 downwards and try the following in F7:
=arrayformula(ifna(if(sign(match(C7:C13,A7:A10,0))=ifna(sign(match(C7:C13&D7:D13,A7:A10&B7:B10,0))),"Match","Mismatch in type"),"No match"))
We are creating two arrays corresponding to whether the 'column' or 'column' AND 'type' entries match in both Source and Target, then using IF/IFNA to assign the required results based on whether the overall result was TRUE/FALSE/#N/A.
EDIT: To make the formula dynamic (as per the comment):
=arrayformula(lambda(source,target,
ifna(if(sign(match(index(target,,1),index(source,,1),0))=ifna(sign(match(index(Target,,1)&index(Target,,2),index(source,,1)&index(source,,2),0))),"Match","Mismatch in type"),"No match"))(
Source!A2:index(Source!B2:B,counta(Source!B2:B)),
Target!A2:index(Target!B2:B,counta(Target!B2:B))))

In Google Sheets, how do I filter based on the value of another cell?

This might seem like a simple question, but I'm really struggling to get it to work. Google Sheets has 'filter by condition', so I'm hoping I can enter the condition of a cell value in order to filter on rows with only that value.
So for example, in a column called Manager, I would like to filter by condition from another tab on cell =Sheet1!A2, where this is the manager name. However, it's only pulling through rows where the cell is blank.
Does anyone know how this could work, or even if it's meant to work the way I would like?
if this is filter view not FILTER formula then you need to use INDIRECT because you refer to value on another sheet. try:
=INDIRECT("Sheet1!A2")

Importrange but only include certain values

I would like to create a new sheet from Google Form data which only imports cell data that matches specific criteria. Respondents have five response options for a number of questions (all questions have the same five options). I want the new sheet to only show the data in the cells that fit my criteria and the cells that don't, should be blank. I would like all rows and column formatting to remain the same.
I've got the import range part down, but I don't know should I use query, filter, if, or some other function?
Within the same spreadsheet, QUERY works well. You could also use QUERY(IMPORTRANGE( or just IMPORTRANGE if you want it to go to a different spreadsheet.
As Rubén said, if you want to maintain all the formatting, without manually doing it yourself on the destination sheet, you'll need to use script.
Query Reference
EDIT
See Sheet3 HERE. Make a copy to edit.
Any cell with a blue background has a formula. The main one is below.
=ARRAYFORMULA(IF('Form Responses 1'!D3:DD="","",SWITCH('Form Responses 1'!D3:DD,$D$1,"",$E$1,"",'Form Responses 1'!D3:DD)))
You will not be able to edit those columns. If you need to edit (like the "Comments/Adaptations" columns, you could modify the formula above and apply it column by column.
If that works, please click the green check mark to accept the answer!
Beside the number format, any formula keeps the format of the source range, so if your the format includes fonts styles, bold, italics, colors, etc., instead of a formula you should use a script.

ARRAYFORMULA with IMPORTRANGE

In column B are listed IDs of Google Sheets. In column C are listed cells, from which I want to import data.
Screenshot of the table
In column D is shown the result of using IMPORTRANGE() by simply dragging it. e.g. for D1 it looks like:
=IMPORTRANGE(B1;C1)
for D2:
=IMPORTRANGE(B2;C2)
and so on.
In column E I want to display the same result but using ARRAYFORMULA that looks like:
=ARRAYFORMULA(IMPORTRANGE(B2:B4,C2:C4))
but the function displays only the data from the first spreadsheet.
People complain about this permissions issue a lot, but it's not hard to solve. What I do is have a sheet which I name "Splash sheet" into which I paste the URLs of the documents I wish to link. To its right is a column headed "permit to connect" which contains IMPORTRANGE formulas importing a single cell from each sheet -- usually a cell containing a confirmation code, number or document name -- on a sheet also named "Splash Sheet." For example,
=IF(B3="enter URL",,CONCATENATE(IMPORTRANGE(B3,"Splash sheet!A1")," ",IMPORTRANGE(B3,"Splash sheet!B1")))
So, when you first connect a spreadsheet via its URL, you get those messages telling you you need to connect, you click the Permit Access, the confirmation code/number/document name appears in the second column, and voilá, your sheets are connected forevermore! Now all your other IMPORTRANGEs referencing that URL will work, and you can use IMPORTRANGE formulas that reference the URL-containing cells on the "splash sheet."
As for the OP's original question, I came here seeking an answer to the same problem, and after more research have realized that we are attempting the impossible here. No way to do this an ARRAYFORMULA. No way around writing formulas that reference every single cell a document's URL may go into.
Problem is you can't make arrays of arrays in spreadsheets; that would involve multiple dimensions, and the medium is inherently two-dimensional. This is what people use databases for.
ARRAYFORMULA doesn't work when importing data (I think it relates to permissions). You could use something like this, =IFERROR(IMPORTRANGE(B5:B7;C5:C7)) and pre-fill the column first, but still there would be the permissions issue. Each new imported sheet needs it's permissions granted by a user.
TLDR: If I understand your intention correctly when you say you would like to see
=ARRAYFORMULA(IMPORTRANGE(B2:B4,C2:C4)), I believe you can make that
happen using the following.
=ARRAYFORMULA(IMPORTRANGE(
INDIRECT(ADDRESS(ROW(B2:B4), COLUMN(B2:B4)),
INDIRECT(ADDRESS(ROW(C2:C4), COLUMN(C2:C4))
)
Breakdown
Use IMPORTRANGE with INDIRECT to create ranges inside ARRAYFORMULA
Call INDIRECT with the ADDRESS function
Call ADDRESS with the ROW and COLUMN functions since they take ranges via ARRAYFORMULA
using IMPORTRANGE with INDIRECT
IMPORTRANGE's two parameters are the spreadsheet url stored in B2:B4 for this example and the range (e.g. sheet!A1:B2) stored in C2:C4.
Since IMPORTRANGE doesn't take a range reference directly as you mentioned, you'll need to build it for each row with ARRAYFORMULA using the INDIRECT function.
INDIRECT can be used to compose a cell reference using A1 notation, for instance
=IMPORTRANGE(INDIRECT("B" & 2), INDIRECT("C" & 2))
will produce the same result as
=IMPORTRANGE(B2, C2)
Since this produces the same result, we now just have to find a way to make INDIRECT work with ARRAYFORMULA
Use ADDRESS to build the parameters for INDIRECT
Next you want to use ADDRESS to build the A1 reference for INDIRECT. For the current purposes, ADDRESS takes a numerical value for row and column as parameters
=INDIRECT(ADDRESS(2,2))
will produce the same result as
=INDIRECT("B" & 2)
Since these two are interchangeable, now we just need to find a way to get the numerical row and column values out of ARRAYFORMULA.
Call ADDRESS using the ROW and COLUMN functions
From there, you can get the row and column indexes from standard A1 notation using the ROW and COLUMN functions. While this may seem like we're pointlessly going in circles, the difference now is that ROW and COLUMN perform as expected with the ranges provided by ARRAYFORMULA. So given that ADDRESS will return $B$2 using using either method below
=ADDRESS(2,2)
or
=ADDRESS(ROW(B2),COLUMN(B2))
we now know that
=ARRAYFORMULA(ADDRESS(ROW(B2:B4),COLUMN(B2:B4)))
will produce the following array of addresses
{ $B$2; $B$3; $B$4 }
Final Assembly
So when we put this all together, we get
=ARRAYFORMULA(IMPORTRANGE(
INDIRECT(ADDRESS(ROW(B2:B4), COLUMN(B2:B4)),
INDIRECT(ADDRESS(ROW(C2:C4), COLUMN(C2:C4))
)
where INDIRECT(ADDRESS(ROW(B2:B4), COLUMN(B2:B4)) is more or less interchangeable with what you might expect from B2:B4 inside ARRAYFORMULA and represents the url parameter
and INDIRECT(ADDRESS(ROW(C2:C4), COLUMN(C2:C4)) is roughly interchangeable with what you might expect from C2:C4 inside ARRAYFORMULA and represents the range parameter.
Suggestions on organization
I recommend using the indentation (Alt +Enter to create a new line ) above along with your indentation of choice to keep it easier to read. In the end it's just a bit more syntactic sugar and if spaces are used well it shouldn't be much harder to understand and make changes to 6 months later.
RE: Permissions - as mentioned by Atiq Zabinski, just placing a simple
IMPORTRANGE("http:/xxxx", "A1") somewhere on the sheet will provide a
means to know if the sheet is connected or not and the error message
should give you a context menu for connecting the sheet. You'll might
want to stay away from error handling in these scenarios as it will
slow down the process of connecting the sheets.

Using CONCATENATE with Google forms and sheets

I have a survey going out with Google Forms, but to analyse the results, I would need to concatenate some cells. However, due to the nature of Google Forms, whenever a new response is recorded, a new row is added. I've read around, looking at different forums and tutorials, but can't seem to find anything that works.
Some of the places I've looked are:
concatenate column values for each row that gets added after google form submission
https://productforums.google.com/forum/#!topic/docs/0Os52U-0i1k
So what I would need help with is if it's possible to concatenate results from a Google Form without having to manually copy the formula in the cells whenever there are new responses. I've tried ArrayFormula, but I can't seem to get it to work. Any help would be much appreciated!
ArrayFormula(A2:A & B2:B) should do the trick.
Note that the formula will persist even if you put it directly at the end of the form and then add a new field.
It will just be shifted to the right, so you don't need to worry about taking care of that when you modify your form.
The CONCATENATE function is a Google spreadsheet function that combines two or more text strings into a single string. It appears in the dropdown menu for functions above cell A1, and when you select it, it places an =CONCATENATE()= formula in the selected cell.
Note that you may need to replace spaces with "&" if your text has spaces.
In order to perform this operation on Google Forms though, you will need to set up Form Embeds by making sure you have the input type of "google form embed." When embedded forms are enabled, there is no need for individual cells within a google sheet workbook with custom formulas next to each question result button as they're all being calculated.
You can find more info on CONCATENATE by referring to this.

Resources