Need tiny bit of help with =Left + =find

Vexorg

Board Regular
Joined
Oct 5, 2010
Messages
116
Hey,

I have this in one cell:
<table bgcolor="#ffffff" border="1" cellspacing="0"><caption>
</caption> <thead> <tr> <th bgcolor="#c0c0c0">1013/1392</th> </tr> </thead> <tbody> </tbody> <tfoot></tfoot> </table>
and in another cell i want this to return:
<table bgcolor="#ffffff" border="1" cellspacing="0"><caption>
</caption> <thead> </thead> <tbody> <tr valign="TOP"> <td>1916 Requests (2297 Accounts)
</td> </tr> </tbody> <tfoot></tfoot> </table>


This is the macro im using:
Code:
=LEFT(C31,FIND("/",C31)-1)&" Requests ("&RIGHT(C31,FIND("/",C31))&" Accounts)"
Unfortunately this is returning '1916 Requests (/2297 Accounts)'. And I get an error every time i remove the "/"

Any help is appreciated.

Thanks
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Not tested but maybe
Code:
=LEFT(C31,FIND("/",C31)-1)&" Requests ("&RIGHT(C31,FIND("/",C31)+1)&" Accounts)"

By the way, that's not a macro, it's a formula, and it's not at all clear how 1013/1392 is meant to become 1916 . . . 2297. . .
;-)
 
Upvote 0
try:
Code:
=LEFT(C31,FIND("/",C31)-1)&" Requests ("&RIGHT(C31,FIND("/",C31)-1)&" Accounts)"
 
Upvote 0
I should have tested it !

JoeMo's suggestion works on the sample given.
But be careful, I think it's a bit of a coincidence, based on the length of the numbers used.

For example, if your input data was 4/12, it doesn't work correctly.
Or 300/1000.

I think the MID function would work better than RIGHT.

Try this
Code:
=LEFT(C31,FIND("/",C31)-1)&" Requests 
("&MID(C31,FIND("/",C31)+1,255)&" Accounts)"
 
Upvote 0
Or you could just go with

=SUBSTITUTE(C31,"/"," requests (")&" Accounts)"

:biggrin:
 
Upvote 0
Haha sorry i meant formula, and i meant for this numbers to be the same. I posted this quick before i left work :nya:.

Thank you for the recommendations, i think i will go with jasonb's solution.
 
Upvote 0

Forum statistics

Threads
1,224,585
Messages
6,179,696
Members
452,938
Latest member
babeneker

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