Extract Number after "="

Sufiyan97

Well-known Member
Joined
Apr 12, 2019
Messages
1,614
Office Version
  1. 365
  2. 2013
Platform
  1. Windows
I have an issue with below formula to extract number after "=" something is not right with row 28

March Bills.xlsx
GHI
1TotalDateExracted Number
240+8+11+1+1=61✔01-03-202161
336+10+3=49✔02-03-202149
430+27+3+5=65✔03-03-202165
53+39+12+1+10+1=66✔04-03-202166
639+1+3+3+3+3=52✔05-03-202152
73+36+3+20+2+2+2=68✔06-03-202168
835+10+4=49✔07-03-202149
93+38+24+4+5+1=75✔08-03-202175
108+33+12+3+2+12=70✔09-03-202170
111+40+24+2=67✔10-03-202167
1240+14+5+4+1=62✔11-03-202162
135+36+3+1+3+1+1+5=55✔12-03-202155
1438+3+15+2+4=66✔13-03-202166
1521+3+37+16+3=80✔14-03-202180
1636+15+6+1=58✔15-03-202158
1738+6+1=45✔16-03-202145
1840+26+7+1=74✔17-03-202174
1949+19+1+1=70✔18-03-202170
2043+15+1+3+1=63✔19-03-202163
2120+6+33+13+1+17+4+1=95✔20-03-202195
2238+33+5+3+30+3+9=121✔21-03-2021121
235+36+16+3+3=66✔22-03-202166
2439+26+3+4=72✔23-03-202172
2544+27+5+2+5=83✔24-03-202183
2645+12+2+2=61✔25-03-202161
2743+3+22+1+1+2=72✔26-03-202172
2840+23+5+5=73✔ ghate che 127-03-202173 ghate
292+35+3+12+3=55✔28-03-202155
3032+15+1+3=51✔29-03-202151
313+43+13+2+2+1+2=66✔30-03-202166
3241+18+2=61✔31-03-202161
Sheet2
Cell Formulas
RangeFormula
I2:I32I2=TRIM(SUBSTITUTE(MID(G2,SEARCH("=",G2)+1,10),"✔",REPT(" ",99)))
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Try this instead

Excel Formula:
=REPLACE(LEFT(G2,FIND("✔",G2)-1),1,FIND("=",G2),"")+0

If you are happy to have that number returned as text you can remove the "+0" at the end.
 
Upvote 0
Solution
Hi,

Are your strings Always 2 characters?

Try these:

Book3.xlsx
GHIJ
1TotalDateText resultNumber result
240+8+11+1+1=61✔3/1/20216161
336+10+3=49✔3/2/20214949
430+27+3+5=65✔3/3/20216565
53+39+12+1+10+1=66✔3/4/20216666
639+1+3+3+3+3=52✔3/5/20215252
73+36+3+20+2+2+2=68✔3/6/20216868
835+10+4=49✔3/7/20214949
93+38+24+4+5+1=75✔3/8/20217575
108+33+12+3+2+12=70✔3/9/20217070
111+40+24+2=67✔3/10/20216767
1240+14+5+4+1=62✔3/11/20216262
135+36+3+1+3+1+1+5=55✔3/12/20215555
1438+3+15+2+4=66✔3/13/20216666
1521+3+37+16+3=80✔3/14/20218080
1636+15+6+1=58✔3/15/20215858
1738+6+1=45✔3/16/20214545
1840+26+7+1=74✔3/17/20217474
1949+19+1+1=70✔3/18/20217070
2043+15+1+3+1=63✔3/19/20216363
2120+6+33+13+1+17+4+1=95✔3/20/20219595
2238+33+5+3+30+3+9=121✔3/21/20212121
235+36+16+3+3=66✔3/22/20216666
2439+26+3+4=72✔3/23/20217272
2544+27+5+2+5=83✔3/24/20218383
2645+12+2+2=61✔3/25/20216161
2743+3+22+1+1+2=72✔3/26/20217272
2840+23+5+5=73✔ ghate che 13/27/20217373
292+35+3+12+3=55✔3/28/20215555
3032+15+1+3=51✔3/29/20215151
313+43+13+2+2+1+2=66✔3/30/20216666
3241+18+2=61✔3/31/20216161
Sheet891
Cell Formulas
RangeFormula
I2:I32I2=RIGHT(REPLACE(G2,FIND("✔",G2),99,""),2)
J2:J32J2=RIGHT(REPLACE(G2,FIND("✔",G2),99,""),2)+0
 
Upvote 0
Thank you very much Peter_SSs

Works Perfect

Can you please explain what's the problem with my formula in row 28
 
Upvote 0
Hi,

Are your strings Always 2 characters?

Try these:

Book3.xlsx
GHIJ
1TotalDateText resultNumber result
240+8+11+1+1=61✔3/1/20216161
336+10+3=49✔3/2/20214949
430+27+3+5=65✔3/3/20216565
53+39+12+1+10+1=66✔3/4/20216666
639+1+3+3+3+3=52✔3/5/20215252
73+36+3+20+2+2+2=68✔3/6/20216868
835+10+4=49✔3/7/20214949
93+38+24+4+5+1=75✔3/8/20217575
108+33+12+3+2+12=70✔3/9/20217070
111+40+24+2=67✔3/10/20216767
1240+14+5+4+1=62✔3/11/20216262
135+36+3+1+3+1+1+5=55✔3/12/20215555
1438+3+15+2+4=66✔3/13/20216666
1521+3+37+16+3=80✔3/14/20218080
1636+15+6+1=58✔3/15/20215858
1738+6+1=45✔3/16/20214545
1840+26+7+1=74✔3/17/20217474
1949+19+1+1=70✔3/18/20217070
2043+15+1+3+1=63✔3/19/20216363
2120+6+33+13+1+17+4+1=95✔3/20/20219595
2238+33+5+3+30+3+9=121✔3/21/20212121
235+36+16+3+3=66✔3/22/20216666
2439+26+3+4=72✔3/23/20217272
2544+27+5+2+5=83✔3/24/20218383
2645+12+2+2=61✔3/25/20216161
2743+3+22+1+1+2=72✔3/26/20217272
2840+23+5+5=73✔ ghate che 13/27/20217373
292+35+3+12+3=55✔3/28/20215555
3032+15+1+3=51✔3/29/20215151
313+43+13+2+2+1+2=66✔3/30/20216666
3241+18+2=61✔3/31/20216161
Sheet891
Cell Formulas
RangeFormula
I2:I32I2=RIGHT(REPLACE(G2,FIND("✔",G2),99,""),2)
J2:J32J2=RIGHT(REPLACE(G2,FIND("✔",G2),99,""),2)+0
Thank you jtakw for reply
as you can see some times there is 3 characters like in row 22
 
Upvote 0
Sorry, missed row 22, 3 characters.
 
Upvote 0
Thank you very much @Peter_SSs

Works Perfect
You're welcome. Glad it worked for you.

Can you please explain what's the problem with my formula in row 28
Yes.
Your formula finds the "=" sign and then takes the next 10 characters. In row 28 that part would return "73✔ ghate "
It then replaces the ✔ with 99 spaces(see note below) producing a string like this (where . represents a space) only with more spaces: "73....................ghate."
Trim then removes the space at the right and reduces the internal space to one, giving "73 ghate"

Note: Replacing the ✔ with 99 spaces achieves nothing as those spaces are then immediately removed by the TRIM() function
 
Upvote 0
You're welcome. Glad it worked for you.


Yes.
Your formula finds the "=" sign and then takes the next 10 characters. In row 28 that part would return "73✔ ghate "
It then replaces the ✔ with 99 spaces(see note below) producing a string like this (where . represents a space) only with more spaces: "73....................ghate."
Trim then removes the space at the right and reduces the internal space to one, giving "73 ghate"

Note: Replacing the ✔ with 99 spaces achieves nothing as those spaces are then immediately removed by the TRIM() function
Thank you very much Peter for explaining,

Now I got your point.
 
Upvote 0
工作簿1
GHI
1TotalDateExracted Number
240+8+11+1+1=61✔2021/3/161
336+10+3=49✔2021/3/249
430+27+3+5=65✔2021/3/365
53+39+12+1+10+1=66✔2021/3/466
639+1+3+3+3+3=52✔2021/3/552
73+36+3+20+2+2+2=68✔2021/3/668
835+10+4=49✔2021/3/749
93+38+24+4+5+1=75✔2021/3/875
108+33+12+3+2+12=70✔2021/3/970
111+40+24+2=67✔2021/3/1067
1240+14+5+4+1=62✔2021/3/1162
Sheet1
Cell Formulas
RangeFormula
I2:I12I2=-LOOKUP(,-LEFT(MID(G2,FIND("=",G2)+1,9),ROW($1:9)))
 
Upvote 0
Hi,

Just back to fix my formulas in Post #3:

Book3.xlsx
GHIJ
1TotalDateText resultNumber result
240+8+11+1+1=61✔3/1/20216161
336+10+3=49✔3/2/20214949
430+27+3+5=65✔3/3/20216565
53+39+12+1+10+1=66✔3/4/20216666
639+1+3+3+3+3=52✔3/5/20215252
73+36+3+20+2+2+2=68✔3/6/20216868
835+10+4=49✔3/7/20214949
93+38+24+4+5+1=75✔3/8/20217575
108+33+12+3+2+12=70✔3/9/20217070
111+40+24+2=67✔3/10/20216767
1240+14+5+4+1=62✔3/11/20216262
135+36+3+1+3+1+1+5=55✔3/12/20215555
1438+3+15+2+4=66✔3/13/20216666
1521+3+37+16+3=80✔3/14/20218080
1636+15+6+1=58✔3/15/20215858
1738+6+1=45✔3/16/20214545
1840+26+7+1=74✔3/17/20217474
1949+19+1+1=70✔3/18/20217070
2043+15+1+3+1=63✔3/19/20216363
2120+6+33+13+1+17+4+1=95✔3/20/20219595
2238+33+5+3+30+3+9=121✔3/21/2021121121
235+36+16+3+3=66✔3/22/20216666
2439+26+3+4=72✔3/23/20217272
2544+27+5+2+5=83✔3/24/20218383
2645+12+2+2=61✔3/25/20216161
2743+3+22+1+1+2=72✔3/26/20217272
2840+23+5+5=73✔ ghate che 13/27/20217373
292+35+3+12+3=55✔3/28/20215555
3032+15+1+3=51✔3/29/20215151
313+43+13+2+2+1+2=66✔3/30/20216666
3241+18+2=61✔3/31/20216161
Sheet891
Cell Formulas
RangeFormula
I2:I32I2=MID(LEFT(G2,FIND("✔",G2)-1),FIND("=",G2)+1,99)
J2:J32J2=MID(LEFT(G2,FIND("✔",G2)-1),FIND("=",G2)+1,99)+0
 
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