How to add a simple quote into a text string? - excel

I have a name list like
Horak
Marek
Tihoun
etc...
and I want
'Horak'
'Marek'
'Tihoun'
I'm quite new to Excel, is there a way how to do that?
Thanks in advance.

Assuming that your data is in column A, isn't this as straight-forward as something like:
="'" & A1 & "'"
This will concatenate the quote ' with the data in A1 with another quote '.

If Horak was in cell A1 put the following in cell B1 and drag down for as many rows as you have entries in column A.
="'"&A1&"'"
You could also use
=CONCATENATE("'",B2,"'")
Example usage shown:

That can be done through the following ways...
When you want to add the ' to text by &
="'"&"Horak"&"'"
When you want to add the ' to column by &
="'" & [ColumnIndex] & "'"
When you want to add the ' to column by CONCATENATE()
=CONCATENATE("'",[ColumnIndex],"'")

Related

create hyperlink using cell value and some additional text in excel

I have excel sheet containing column with values such as
BANDHANBNK
SRF
SRTRANSFIN
L&TFH
IBULHSGFIN
FEDERALBNK
PNB
PEL
VOLTAS
I want to create hyperlink for each of this, url can be created as
https://in.tradingview.com/chart/?symbol=NSE:ACC1!
so I need to concatenate
https://in.tradingview.com/chart/?symbol=NSE: + cell value + 1!
doing this manually is too much work, is there any simpler way to do this?
one more thing is if cell value contains & or - it should be converted to underscore.
Use following formula. Here simply concatenating cell value with URL then concatenate 1!. Use Hyperlink() formula to make hyperlink.
=HYPERLINK("https://in.tradingview.com/chart/?symbol=NSE:" & A1 & "1!",A1)
To replace & and - by underscore _ use below SUBSTITUTE() formula.
=SUBSTITUTE(SUBSTITUTE(A1,"&","_"),"-","_")
this worked for me.
=HYPERLINK("https://in.tradingview.com/chart/?symbol=NSE:" & SUBSTITUTE(SUBSTITUTE(E2,"&","_"),"-","_") & "1!",E2)

How to find a specific number in a string of numbers in Excel

I am looking for help with a formula in Excel to find a specific number in a string of numbers.
Our accounting system pulls a report showing numbers from 1 to 10 and each line can have numerous numbers listed in the cell, each separated with a ";".
What I want to do is create a formula that allows me to simply look for the number in columns O to X (row 3) and fill that number in the corresponding cell.
So starting from row 4, I would like to create a formula that finds each number in the string and simply fills in the one I am looking for in each cell, for example I would like the end result to look like the below example:
If the number doesn't appear then that column is left blank, but if it is found it simply adds itself into the corresponding column.
Hopefully someone out there can help me with this.
Regards;
Greg
formula in B3
in German:
=WENN(ISTFEHLER(FINDEN(";" & B$2 & ";"; ";" & $A3 & ";"));"";B$2)
in English:
=IF(ISERROR(FIND(";" & B$2 & ";" , ";" & $A3 & ";")),"",B$2)
Try this in cell O4:
=IF(NOT(ISERROR(SEARCH(O$3,$N4,1))),O$3,"")
Notes:
Assumes your numbers 1 to 10 are in row 3 (i.e O3:X3)

How to change string name to specific string name?

I want Excel (or Linux command) to change the string of values.
From:
e.g. column A
IN_EMAIL.201_101300_180403_131131_6160_5593
To:
e.g. column B
EMAIL.201_101300_0_180403_131131616_0000_5593
So:
Remove "IN_"
Add "0_" after 20th character
Remove "_" after 33rd character
Add "_000" after 37th character
I've got two formulas. How can I nest them into one?
=REPLACE(REPLACE(A4;1;3;"");18;0;"0_")
=REPLACE(REPLACE(B4;33;1;"");36;0;"_000")
It is solved,
=REPLACE(REPLACE(REPLACE(REPLACE(A11;1;3;"");18;0;"0_");33;1;"");36;0;"_000")
If you want to combine these two formulas:
=REPLACE(REPLACE(A4;1;3;"");18;0;"0_")
=REPLACE(REPLACE(B4;33;1;"");36;0;"_000")
Just replace B4 with the first formula
=REPLACE(REPLACE(REPLACE(REPLACE(A4;1;3;"");18;0;"0_");33;1;"");36;0;"_000")
Alternatively you could use the following formula that might be more obvious:
=MID(A5;4;17) & "0_" & MID(A5;21;13) & MID(A5;35;3) & "_000" & RIGHT(A5;6)

excel function to combine cells into single line of text?

I'm new to stack overflow so I apologize if this is a horrendously stupid question. I am wondering if there is a function or way to code a function in excel that will combine a column of cells with plain text and convert them into one cell with the text on a single line? Specifically I want to convert a column of random numbers into a single line of text and insert SPACE+AND+SPACE between them.
Ex.
15133484
12345188
12345888
to
15133484 AND 12345188 AND 12345888
Currently I am copying and pasting all this information into google and then into Word and using find/replace and it is taking forever everytime. If it is possible to just get Excel to do this for me that would be amazing.
Thanks!
If you have Office 365 Excel use TEXTJOIN():
=TEXTJOIN(" AND ",TRUE,A:A)
otherwise one would have to use:
=A1 & " AND " & A2 & " AND " & A3
Or one can use a helper column, B1 put:
=A1
put this in B2 and copy down:
=IF(A2<>"",B1 & " AND " & A2,B1)
And grab the last cell in column B.
A little late, but still:
Reference here
Step 1:
=concatenate(transpose(rngBeg:rngEnd & " AND "))
Step 2:
highlight the transpose statement and then press F9, which substitutes the actual values for the formula.
Step 3:
Remove the curly braces, { }, from the formula. The cell will display the range of reference cells combined with whatever separator chosen after the ampersand sign.
Not a "live" formula, but still far easier than manually concatenating a range of values.
Press ALT+F11 to open Microsoft Visual Basic for Applications,
Insert-> Module
Paste this:
Function Combine(WorkRng As Range, Optional Sign As String = " AND ") As String
Dim Rng As Range
Dim OutStr As String
For Each Rng In WorkRng
If Rng.Text <> "," Then
OutStr = OutStr & Rng.Text & Sign
End If
Next
Combine = Left(OutStr, Len(OutStr) - 5)
End Function
In any cell type =Combine(Range)
i.e.
=Combine(A1:A500)
use concat function if you can add an additional column in the excel like this:
=CONCAT(D3:E5)
Attached sample image with input, additional column, output and formula
I assume you want to merge the data in the 3 cells into a single cell with a space between the 3 data set.
If that is the case then you can do it simply by using the Concatenate function in excel.
In the above example, you have data in Cells A1, A2 & A3.
Cell C1 has the merged data. As you can see, we have used CONCATENATE Function.
The space has been defined in Double quotes. So if you need a Hyphen (-), you can put that in Double Quotes with space “ - ” and it will display the result with Sanjay - Singh - Question
Hope this helps.

Merge data into new cell if other cells match

I have a table in my workbook that pulls information from another sheet. In column A there are names; A1=Tom, A2=Sarah, A3=Steve, etc.. Column B has dates; B1=July26, B2=August08, B3=July26, etc.
There are 10 rows in my table. What I'm trying to do is compress the information down into a single cell C1, and have it as a single line of text. So for this example: "Tom,Steve: July26, Sarah: August08"
Right now I've been building an IF statement to compare, but I was wondering if there was a better way; one that doesn't risk a typo mid way that misses something.
This is what I have (I've started from the bottom (row 10) and building up: =IF(B9<>B10,A9&": "&B9&" "&A10&": "&B10,A9&","&A10&": "&B9)
Any help would be appreciated, thanks
I think that your process of building from the bottom up is the correct way. Otherwise a single formula would be too complicated, and VBA might be necessary.
To build from the bottom up, this is the formula you need at C10. Enter it then copy/paste into C1:C10.
C10:
=A10 & IF(B10=B11, ",", ": " &TEXT(B10, "mmmmdd") & ". ") & C11
p.s. it supposes that your column B contains dates formatted this way. If they are actually text, then replace TEXT(B10, "mmmmdd") with simply B10:
=A10 & IF(B10=B11,",", ": " & B10 & ". ") & C11

Resources