How to reference a cell in a excel hyperlink - excel

This is what I have tried
=HYPERLINK("#"+M4+"!A1","Go To Go To Store")
The first section does not add the cell value to the other parts of the string.
It outputs "#"+"Text"+"!A1" instead of #Text!A1
If I am far off the overall objective is to get a list of hyperlinks to every spreadsheet into a drop down list please can you advise on that

You need using text concatenation. But + is only add up operator in Excel. Text concatenation is &.
So
=HYPERLINK("#"&M4&"!A1","Go To Go To Store")
But if the single sheet names in M4 can be multiple words delimited with spaces, then they must be enclosed within single quotes. So
=HYPERLINK("#'"&M4&"'!A1","Go To Go To Store")
will be more flexible.

Related

Write data from a list if the adjacent cell contains certain string

I need to update hundreds of cells, and that would be trivial automating, but I am not being able to make it work.
I have a list like the following:
And, in a different tab, a list I have to populate with values above (in B) based on the appearance of the twitter handle in other column.
The names are within a long text string (all of them begin with #), and it is not possible to re-order the list based on those names. Also, there are more names than values, so some cells will remain blank.
Is there a way I can write a formula that writes the values of the first list into the second one if the name in column A in that row is contained within the adjacent string?
Thanks!
You can refer to this sample formula (Same sheet was used):
=arrayformula(if(C2:C<>"",iferror(vlookup(REGEXEXTRACT(C2:C,"\B\#\w+"),A2:B,2,false),""),""))
What it does?
Use array formula to loop column C values
Extract the twitter name (string that starts with #) using Regexextract()
Use the extracted #twittername as search key to get the connections value using vlookup()
Output:
Since we don't have access to the spreadsheet, I can't know for sure what the line-break character is within the Col-A cells of your second sheet. And using this line-break character is important, since Twitter handles may use some non-alphanumeric characters such as the underscore and others which are not included in such REGEX notation as \w. I'm assuming here that the line-break character is CHAR(10) from the ASCII chart.
I also don't know the name of your first sheet; so here, I've just written it as Sheet1. You'll need to replace that with your actual sheet name, remembering to place it in single quotes if it contains anything but alphanumeric characters (e.g., 'Data Sheet').
That said, delete everything from Col-B in your second sheet (including the header "Connections") and place the following formula in cell B1 of that second sheet):
=ArrayFormula({"Connections"; IF(A2:A="",, IFERROR(VLOOKUP(REGEXEXTRACT(SUBSTITUTE(A2:A,CHAR(10),"~"),"#[^~]+"),Sheet1!A:B,2,FALSE)))})

reformat excel text column to specific format

I have a column in my excel that includes authors name and it looks as follows:
My goal is to remove the dates + the last comma from all of these rows to make it something like this:
Is there a way I can do it in excel?
Based on your example, in which there are multiple commas in one cell, I would go with determining the position of the last comma first (in order to know where to slice the content of said cell). Then it's a matter of IF formula based on condition in which the last 4 characters in the cell are digits:
=IF(ISNUMBER(VALUE(RIGHT(A1,4))),LEFT(A1,FIND("#",SUBSTITUTE(A1,",","#",LEN(A1)-LEN(SUBSTITUTE(A1,",",""))))-1),A1)
FYI: The "#" substitution is targeted at knowing exactly where the last comma occurs in the cell. Any other unique, not-appearing-in-the-string character would have done the same job.
I've tested the formula on below examples:

Need to remove non-matching text from a delimited Excel string

I have an Excel database query to get all the RBAC user roles that are assigned to each user, and the database returns a string delimited by & (ampersands) between each user role, e.g.:
&Admin&Supervisor&ViewReports&WriteReports&
My query filters records that only have a matching string, let's say it's Reports. However it still returns the full list of user roles for a matching user, and in this case some users have >10 roles assigned and it makes the table look really messy and not suitable for printing.
I could manually clean up each row, but there are quite a lot of them, and since this is going to be run regularly I'm wondering if there may be a good Excel formula or VBS method to split delimited sections of a string and only keep ones that match a string criteria.
I'm aware of "Text to Columns" and its ability to make use of delimiters, but it just spat out a ton of columns and made things worse. I've done several searches about cleaning up delimited strings in Excel but couldn't find any results that were similar to my situation: need to split a delimited string and do something RegEx-esque to only keep parts that match a pattern.
Ideally I'd like to keep the cleaned up results in a single cell, so the above example &Admin&Supervisor&ViewReports&WriteReports& would look like:
ViewReports WriteReports
or
ViewReports,WriteReports
or similar, in a single cell. Not too picky about formatting really, just need the non-relevant parts of the string gone.
you could use a combination of trim, mid and substitute to find your values so using your example above:
if oyu have a blank excel sheet and ad your example to cell A3 then place 1,2,3 and 4 in cells B2, C2, D2, E2 then use copy this formula into cell B3:
=TRIM(MID(SUBSTITUTE($A3,"&",REPT(" ",LEN($A3))),(B$2-1)*LEN($A3)+1,LEN($A3)))
this should give you the value "Admin".
After that just pull formulas to the right and you will get all 4 values in your example
Please let me know if you need more explanation.
For more info on this equation please see webpage:
https://exceljet.net/formula/split-text-with-delimiter
This formula will work in Excel/Office 365. It won't work in earlier versions due to the TEXTJOIN function which appeared in 2016.
Assumes the data is simple strings as above (i.e. not an XML document that might contain duplicates of the created nodes. If that were the case, there is another method of splitting the string we could use).
Split the string on the ampersand with FILTERXML
Use a variation of the INDEX function to return an array of the matching sections
Concatenate those sections with TEXTJOIN
=TEXTJOIN(" ",TRUE,INDEX(FILTERXML("<t><s>" & SUBSTITUTE(A1,"&","</s><s>")&"</s></t>","//s"),N(IF(1,{3,5}))))
The …N(IF(1,{3,5}))… portion is how to return an array of values from the INDEX functions. In this case, 3 and 5 refer to the value before the third and fifth ampersand. Note that 1 would return an error, since there is nothing before the first ampersand.
You can return whichever elements you want. You just need to know (or calculate using the MATCH function), the proper index number(s).
Note that, with TEXTJOIN you can specify whatever delimiter you want. I specified a space, but you could specify comma or anything.

If cells contains text along with numeric values, how can I remove the text from the cell?

I am trying to prepare an excel file for import into another software program. The data was originally converted from a text file. The problem is that certain cells with dates or numeric values contain unwanted text, "DELIM". Since I have many rows of data that contains this text, I am trying to create an IF statement to remove the text from the cell. Below is a formula that I have tried, but it is not working:
IF(ISNUMBER)SEARCH("*DELIM*")), "TRUE(DELETE "DELIM")
Is there an IF statement that can be used to delete the unwanted text from the cell?
Thank you.
=SUBSTITUTE(A1,"DELIM","") will delete the exact text "DELIM" (case sensitive) from the text in A1.
If it's a one-time job, it might be easier to use search-and-replace (ctrl-h). If what you want to do is more complex, you may want to process the text file first in a another tool - probably one that offers regular expressions.
May be you can try this instead:
=IF(SEARCH("DELIM",A1)="VALUE!",A1,SUBSTITUTE(A1,"DELIM",""))
the above code searches for the string "DELIM" if it finds it replaces with ""
else it will replicate the same string.

How can I take a large piece of text in one cell and insert carriage returns to break it up into multiple cells?

So I am working on prepping my data for insertion into a sqlite db. Historically, I have put it into excel, and the data in different cells has equated to different rows in my db table (through csv importation).
So now I have a huge bit of text that I have pulled from a webpage which is just in one cell, but I need to break the text up into different cells. How can I insert a carriage return? Or is there a way I can send the data into excel with a symbol that will automatically put it into separate cells? Or could I possibly make my own custom csv file? Aside from cutting the text I want to move, is there a more efficient way?
There are numbers that are in the text that are unique and increasing that I could use to insert something, but I can't figure out how to do it.
Please help!
A 10 step solution…
Select the cell with the huge text:
Insert your delimiter character (e.g. I chose '#') anywhere you wish:
Replace hard returns by your delimiter character:
You can also choose to do the latter with a formula:
=SUBSTITUTE(A1," <— insert ALT+ENTER here for a hard return between the quotes
","#")
This way you will not accidentally skip any hard returns (the conversion wizard chokes on them).
Start the Text to Columns conversion wizard for the selected cell:
Choose delimited:
Choose delimiter:
Copy the resulting range of cells in order to transpose them:
Choose Paste Special on the starting cell for pasting the transposed range:
Select Transpose…
DONE!
Instead of working in Excel, you can also manipulate the CSV file. Just respect the CSV basics and you should be able to (experiment a little and then) get the job done:
A CSV file holds Comma-Separated Values, in a delimited data format that has fields/columns separated by the comma character and records/rows terminated by newlines.
Fields that contain a special character (comma, newline, or double quote), must be enclosed in double quotes, after doubling any existing double quotes (to escape those).
So if you take a look a the huge cell in CSV format (just use any plain text editor), it probably spans several lines and is enclosed in double quotes, like this?
You can split up that one quoted multiline text into e.g. several quote single lines of text, such as shown below:

Resources