I'm new to excel , example of data that i need extract the last number until it found comma ","
712044789659787268,"ほんとやめて、視聴者を殺しに来るのは",1.0
Result should be 1.0
i tried =RIGHT(C1,FIND(",",C1)+1) but didn't solve
try this..
=TRIM(RIGHT(SUBSTITUTE(C1,",",REPT(" ",LEN(C1))),LEN(C1)))
I tried this Formula and it worked.
=SUBSTITUTE(RIGHT(SUBSTITUTE(A18,",",REPT(",",20)),20),",","")
This is basically replacing all "," with 20 commas, taking the last 20 characters and replacing the left commas with blanks.
This will output a string. If you want a number just add a +0 at the end of the formula
You can use this:
=RIGHT(C1,LEN(C1)-FIND(""",",C1)-1)
It just finds the ", and displays the rest of the string after its location.
Related
Here's a string:
Sample text here, EXTRACTTHIS(), and ignore the rest.
I want EXTRACTTHIS() to be extracted, so I used this simple formula:
=MID(LEFT(A5,FIND("()",A5)+1),FIND(" ",A5)+1,LEN(A5))
However I got this:
text here, EXTRACTTHIS()
Of course I can just mod it to be =MID(LEFT(A6,FIND("()",A6)+1),FIND(" ",A6)+10,LEN(A6)) to get EXTRACTTHIS().
But I want this formula to work with the whole column such as the following example:
I give you the next sample: WHAT_IF_THE_STRING_LENGTH_IS_DIFFERENT(), what to do?
The problem is that Excel counts from the left side of the parent string. I want Excel to count the 1st substring ' ' from the right side of the 2nd substring which is (). Is it doable?
In your examples, it appears you want to extract the substring that ends with ().
If that is not what you mean, please be more specific.
Try: =TRIM(RIGHT(SUBSTITUTE(LEFT(A1,FIND("()",A1)+1)," ",REPT(" ",99)),99))
Find the location of the (): FIND("()",A1)
Extract the portion of the string up to and including the ()
LEFT(A1, ... +1) => Sample text here, EXTRACTTHIS()
Then extract the last space separated substring from that
TRIM(RIGHT(SUBSTITUTE(... , " ",REPT(" ",99)),99))
I have two columns. Column A with a single value and Column B with a string of comma-separated values.
I want to find the value in Column A in the string of values in Column B and remove it. Leaving the remainder of the values separated by the commas.
For example:
The SUBSTITUTE formula ive been playing with is =SUBSTITUTE(B2,A2," ")
One issue that I'm running into is some of the values have the "/" character in them which I wish to keep.
Example:
Column A
FC0201F1I
Column B
FC0201F1I,FC0201F1I/FC0201F2I,FC0201F2I
SUBSTITUTE output ruins the Value:
, /FC0201F2I,FC0201F2I
The output I'm looking for:
FC0201F1I/FC0201F2I,FC0201F2I
Any Excel Formula combination or VBA Code to help me in this mystery would be greatly appreciated. I feel the solution is so simple and staring at me in the face but I am unable to see it.
Thank you for all your help!
Add commas to the beginning and end to both strings inside the SUBSTITUTE then use spaces and trim to remove the , if they are added to the front or back and not replaced:
=SUBSTITUTE(TRIM(SUBSTITUTE(SUBSTITUTE(","&B2&",",","&A2&",",""),","," "))," ",",")
Alternatively, this is possible through some xpath in FILTERXML():
Formula in C1:
=TEXTJOIN(",",,FILTERXML("<t>"&A1&"<s>"&SUBSTITUTE(B1,",","</s><s>")&"</s></t>","//s[.!=../text()]"))
Do 2 substitutions, 1 for the search term followed by a column and 1 for the search term preceded by a comma.
=SUBSTITUTE(SUBSTITUTE(B2,","&A2, ""), B2&",","")
Normally I would just use the RIGHT function in excel to split it by finding a specific character such as / and outputting the string that I want.
However, I am finding trouble extracting THISSTRING.txt from d/aaa/THISSTRING.txt. With only one instance of / I would just use a function such as =RIGHT(B17,LEN(B17) - FIND("/",B17))
Here's one way to get the rightmost:
=TRIM(RIGHT(SUBSTITUTE(A1,"/",REPT(" ",99)),99))
Objective: To return the rightmost sub-string from a target string after the last occurrence of a character which appears several times within the target string.
This formula:
=TRIM(RIGHT(SUBSTITUTE(A1,"/",REPT(" ",99)),99))
Provides the correct result under the following conditions:
The sub-string to retrieve does not have more than 99 characters.
The sub-string to retrieve does not contain more than one space character together.
Example: To retrieve a sub-string which is 123 characters long and contains the following characters 1 ABC XXX 123 XYZ.
Point 1 is easily solved by working with the length of the string instead of a fixed number:
=TRIM(RIGHT(SUBSTITUTE(A1,"/",REPT(" ",LEN(A1))), LEN(A1)))
However point 2 can't be overcome with the referred formula.
Proposed solution: The following formula returns the correct result regardless of the conditions mentioned above:
=RIGHT(A1, LEN(A1) - FIND( CHAR(12),
SUBSTITUTE(A1, "/", CHAR(12), LEN(A1) - LEN( SUBSTITUTE(A1, "/", "" )))))
Note: I used non-printable character 12 which is very unlikely to be found in excel, change as required.
Here's another way.....
=REPLACE(B17,1,LOOKUP(2^15,FIND("/",B17,ROW(INDIRECT("1:"&LEN(B17))))),"")
FIND generates an array of values, indicating the first position of a "/" in B17, but with the start point incrementing by 1 each time, which means that the last numeric value in that array is the positon of the last "/".
LOOKUP extracts that value from the array and we can use it in REPLACE function to replace all characters before and at that position with nothing, just leaving you with all characters after the last "/"
You'll get an error if there is no "/" in B17
I've got a fairly simple question and I'm sure that I'm missing something obvious.
I've got say 40 cells and all of them contain a formula in them. Only 38 of those cells actually have string or text in them the remaining two do NOT. They're blank with the exception of the formula.
However when I do a COUNTIF or a COUNTA to try and not count the cells that are filled automatically it is giving me the result of 40.
Ways I've tried this and all go the result of 40:
=COUNTIF(B60:B99,"*")
=COUNTIF(B60:B99)
=(COUNTA(B60-B99)
Does anyone know what I'm doing wrong?
Example of the formula in a blank cell that is being counted:
=IF(ISBLANK('Dodgeball'!B48),"",'Dodgeball'!B48)
Use:
=SUMPRODUCT(--(B60:B99<>""))
as this ignores null strings.
You are attempting to count the cells that are not "" but considering them as blank. Try using
=countif(B60:B99,"<>""""")
To explain that final string of quotes, the first one is an escape character so that the second one is read as quotes within the string, similarly the third and fourth are an escape character and a quote for within the string, and finally we end the string with a quote.
One option would be to insert an additional column and simply use the istext() function. Then you can sum that column to get your text count, because false counts and 0 and true counts as 1.
I am trying to add numbers in excel which contain characters.
For example, I want to add
rs30/-
rs40/-
rs45/-
I want result as rs115/-
I tried
=SUM(IF(ISNUMBER(--A1:A3),--A1:A3))
but that gives zero.
You can use MID to extract the number text from the character string, then VALUE to convert that text to an actual numerical value, then add those using SUM, then use & to concatenate with the characters you want before and after the result.
Example:
="rs" & SUM(VALUE(MID(A1:A3,3,LEN(A1:A3)-4))) & "/-"
entered as an array formula using Ctrl Shift Enter.
You might prefer to strip out rs and /- (with Find & Select), then format as:
"rs"0"/-"