Extract Data from Last "" marks

Dojorgen

Board Regular
Joined
Mar 1, 2018
Messages
59
My current formula is not consistent enough. There is variation so my 118 digits varies. The consistency is that it is always the last "" marks, is there a formula that only displays the text within the last "" marks.

Below is the common text string and the data need would be the last "" marks.


Text:
'CMD/A="ALARM_REPORT"MID/A="vfei2W1234"MTY/A="E" ECD/U4=0 ETX/A="" ALARM_ID/14=860828980 ALARM_STATE/U1=1 ALARM_TEXT/A="IN/OUT-SLIDER PORT1 C SENS2 ERROR""

Current Formula:
=IF(F2="Alarm","",IF(F2="Alarm",MID(D2,118[/B],200),""))
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Wow that was nice what is the 99 represent? is that the number of digits?

It presents: IN/OUT-SLIDER PORT1 C SENS2 ERROR'

Is there a way to get ride of the ' tick mark at the end of the text?
 
Upvote 0
The 99 is pulling the right most 99 characters of the string after I inserted 99 extra spaces. You might change that to a larger number if the desired string can be more than 98 characters long.

As far as the single quote on the end, is it before or after the last double quote " ?
 
Upvote 0
Yes sorry i gave it to you wrong
"IN/OUT-SLIDER PORT1 C SENS2 ERROR""

should be

"IN/OUT-SLIDER PORT1 C SENS2 ERROR"'

looks like there is a single " then after that '. Not double quotes
 
Upvote 0
Ok, try this:

Code:
=SUBSTITUTE(TRIM(RIGHT(SUBSTITUTE(SUBSTITUTE(A1,"""","@",LEN(A1)-LEN(SUBSTITUTE(A1,"""",""))-1),"@",REPT(" ",99)),99)),"""'","")
 
Last edited:
Upvote 0
Hi,

This would also work, C1 formula with quote marks, C2 formula without:


Excel 2010
ABC
1'CMD/A="ALARM_REPORT"MID/A="vfei2W1234"MTY/A="E" ECD/U4=0 ETX/A="" ALARM_ID/14=860828980 ALARM_STATE/U1=1 ALARM_TEXT/A="IN/OUT-SLIDER PORT1 C SENS2 ERROR"""IN/OUT-SLIDER PORT1 C SENS2 ERROR"
2IN/OUT-SLIDER PORT1 C SENS2 ERROR
Sheet1
Cell Formulas
RangeFormula
C1=CHAR(34)&TRIM(RIGHT(SUBSTITUTE(A1,CHAR(34),REPT(" ",100)),300))&CHAR(34)
C2=TRIM(RIGHT(SUBSTITUTE(A1,CHAR(34),REPT(" ",100)),300))
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top