sloppy excel skills... how clean can you be?

Strata

New Member
Joined
Jan 26, 2005
Messages
7
172/26

so i have that in a cell, and i need to split up the first part from the second part... i managed to figure it out, but i had such a sloppy way of doing it

=LEFT(B8,ROUNDDOWN(LEN(B8)/2,0))

I did that, to divide the cell in half and pull that data from it, (luckily none of the amounts would be 1302/3 or soemthing to that effect that woudl mess it all up

i then go:

=IF((RIGHT(B9,LEN(B9)-(LEN(B9))+1))="/",LEFT(B9,(LEN(B9)-1)),B9)

to make sure i clean up any moments there there is 172/, that formula manages to clean up the / and i can get myself the number


Now that's a downright sloppy long formula, anyone out there think of a sexier way to do this type of thing?

j.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
To get the left number:
=--(LEFT(A1,FIND("/",A1)-1))

To get the right number:
=--(REPLACE(A1,1,FIND("/",A1),""))
 
Upvote 0
how's this one:

left: =MID(B8,1,FIND("/",B8,1)-1)
right: =MID(B8,FIND("/",B8,1)+1,LEN(B8))

does -- make text become number?
 
Upvote 0
Yes, -- coerces a number represented as text into an actual number.

As far as your formula's go, if you are going to use MID starting at character 1, you should just use LEFT. I used REPLACE in the second formula (instead of RIGHT or MID) because it only requires 2 functions instead of 3.
 
Upvote 0

Forum statistics

Threads
1,203,174
Messages
6,053,924
Members
444,694
Latest member
JacquiDaly

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