Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default How do I separate numbers?

I have a web query which gives me the result "385/1700" and all I want is the
first part "385" to allow me to do calculations with, but because it's a web
query, it wont let me just format it as a fraction and times it by 1700.. it
comes up with the #VALUE! error.

So I dont know what else to try,
Can anyone help?

Thanks,
Aden
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default How do I separate numbers?

=--(LEFT(A1,FIND("/",A1)-1))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Aden" wrote in message
...
I have a web query which gives me the result "385/1700" and all I want is
the
first part "385" to allow me to do calculations with, but because it's a
web
query, it wont let me just format it as a fraction and times it by 1700..
it
comes up with the #VALUE! error.

So I dont know what else to try,
Can anyone help?

Thanks,
Aden



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default How do I separate numbers?

I would use DataText to Columns with / as the delimiter and skip the righthand
column then Finish.


Gord Dibben MS Excel MVP

On Sat, 10 May 2008 15:21:00 -0700, Aden wrote:

I have a web query which gives me the result "385/1700" and all I want is the
first part "385" to allow me to do calculations with, but because it's a web
query, it wont let me just format it as a fraction and times it by 1700.. it
comes up with the #VALUE! error.

So I dont know what else to try,
Can anyone help?

Thanks,
Aden


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How do I separate numbers?

There is no excuse for this other than it's a weekend and I'm bored<g, but
here is an alternative formula to do the same thing...

=INT(--SUBSTITUTE(A17,"/","."))

Rick


"Bob Phillips" wrote in message
...
=--(LEFT(A1,FIND("/",A1)-1))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"Aden" wrote in message
...
I have a web query which gives me the result "385/1700" and all I want is
the
first part "385" to allow me to do calculations with, but because it's a
web
query, it wont let me just format it as a fraction and times it by 1700..
it
comes up with the #VALUE! error.

So I dont know what else to try,
Can anyone help?

Thanks,
Aden




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 806
Default How do I separate numbers?

Hello,

Or
=--(LEFT(A1,FIND("/",A1&"/")-1))
with a little insurance against non-appearing "/"'s.

Regards,
Bernd


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How do I separate numbers?

LOL...

Now, for the same functionality, my formula ends up being the shorter
one.<g

Well, okay, it is not exactly the same functionality... yours will survive
an entry like 123/abc where as mine won't, but the OP did ask how to
separate "numbers", so that shouldn't be a problem.

Rick


"Bernd P" wrote in message
...
Hello,

Or
=--(LEFT(A1,FIND("/",A1&"/")-1))
with a little insurance against non-appearing "/"'s.

Regards,
Bernd


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default How do I separate numbers?

That makes good sense to me <G

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Bernd P" wrote in message
...
Hello,

Or
=--(LEFT(A1,FIND("/",A1&"/")-1))
with a little insurance against non-appearing "/"'s.

Regards,
Bernd



  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 806
Default How do I separate numbers?

Hello,

ok ok, but just for the fun of it:
=regexpreplace(A1,"^(\d+).*$","$1")

The UDF is he
http://www.sulprobil.com/html/regexp.html

Regards,
Bernd
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default How do I separate numbers?

On Sun, 11 May 2008 09:31:09 -0700 (PDT), Bernd P wrote:

Hello,

ok ok, but just for the fun of it:
=regexpreplace(A1,"^(\d+).*$","$1")

The UDF is he
http://www.sulprobil.com/html/regexp.html

Regards,
Bernd


OR,if you have Longre's morefunc.xll installed (see
http://xcell05.free.fr/morefunc/english/index.htm )

=--REGEX.MID(A1,"\d+")



--ron
  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How do I separate numbers?

That returns 1 for an entry of 1a2/3 (I'm guessing it is quitting at the
first non-digit)... I would think it should return the original text if the
text doesn't meet the pattern number/slash/number. Here is my non-RegEx
attempt for a UDF...

Function GetNumberBeforeSlash(Source As Variant) As Variant
If Not Left(Source, InStr(Source & "/", "/") - 1) Like "*[!0-9]*" And _
Source Like "?*/*" And Not Source Like "*/*/*" Then
GetNumberBeforeSlash = Left(Source, InStr(Source, "/") - 1)
Else
GetNumberBeforeSlash = Source
End If
End Function

Rick


"Bernd P" wrote in message
...
Hello,

ok ok, but just for the fun of it:
=regexpreplace(A1,"^(\d+).*$","$1")

The UDF is he
http://www.sulprobil.com/html/regexp.html

Regards,
Bernd




  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default How do I separate numbers?

On Sun, 11 May 2008 14:45:45 -0400, "Rick Rothstein \(MVP - VB\)"
wrote:

I would think it should return the original text if the
text doesn't meet the pattern number/slash/number.


Then you just change the regex a bit:

=REGEX.SUBSTITUTE(A1,"^(\d+)/\d+$","[1]")

OR, if you want it to return nothing, which would be my preference:

=REGEX.MID(A1,"^\d+(?=/\d+$)")



--ron
  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How do I separate numbers?

No... many years ago I worked with regular expressions in the Unix world and
am well aware of their many "charms".<g

Rick


"Rob L" wrote in message
u...
I'll bet he's sorry he asked THAT question now.....

Rob L

"Ron Rosenfeld" wrote in message
...
On Sun, 11 May 2008 14:45:45 -0400, "Rick Rothstein \(MVP - VB\)"
wrote:

I would think it should return the original text if the
text doesn't meet the pattern number/slash/number.


Then you just change the regex a bit:

=REGEX.SUBSTITUTE(A1,"^(\d+)/\d+$","[1]")

OR, if you want it to return nothing, which would be my preference:

=REGEX.MID(A1,"^\d+(?=/\d+$)")



--ron




  #13   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 29
Default How do I separate numbers?

I'll bet he's sorry he asked THAT question now.....

Rob L

"Ron Rosenfeld" wrote in message
...
On Sun, 11 May 2008 14:45:45 -0400, "Rick Rothstein \(MVP - VB\)"
wrote:

I would think it should return the original text if the
text doesn't meet the pattern number/slash/number.


Then you just change the regex a bit:

=REGEX.SUBSTITUTE(A1,"^(\d+)/\d+$","[1]")

OR, if you want it to return nothing, which would be my preference:

=REGEX.MID(A1,"^\d+(?=/\d+$)")



--ron



  #14   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default How do I separate numbers?

Thanks Bob! :D Exactly the formula I needed...
Im shocked people actually know this! It seems really complicated...
I suppose the more I use it the better I'll become... Anyway, I'm only 14 so
I have a reason :D

Do you know of any good sites which help with Excel? because the one I am
working on at the moment is quite complex and I don't know a lot of the
formulas.

Thanks,
Aden

"Bob Phillips" wrote:

=--(LEFT(A1,FIND("/",A1)-1))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Aden" wrote in message
...
I have a web query which gives me the result "385/1700" and all I want is
the
first part "385" to allow me to do calculations with, but because it's a
web
query, it wont let me just format it as a fraction and times it by 1700..
it
comes up with the #VALUE! error.

So I dont know what else to try,
Can anyone help?

Thanks,
Aden




  #15   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default How do I separate numbers?

Why don't you post it here?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Aden" wrote in message
...
Thanks Bob! :D Exactly the formula I needed...
Im shocked people actually know this! It seems really complicated...
I suppose the more I use it the better I'll become... Anyway, I'm only 14
so
I have a reason :D

Do you know of any good sites which help with Excel? because the one I am
working on at the moment is quite complex and I don't know a lot of the
formulas.

Thanks,
Aden

"Bob Phillips" wrote:

=--(LEFT(A1,FIND("/",A1)-1))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"Aden" wrote in message
...
I have a web query which gives me the result "385/1700" and all I want
is
the
first part "385" to allow me to do calculations with, but because it's
a
web
query, it wont let me just format it as a fraction and times it by
1700..
it
comes up with the #VALUE! error.

So I dont know what else to try,
Can anyone help?

Thanks,
Aden






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
separate numbers out of string joesf16 Excel Worksheet Functions 3 May 2nd 07 07:15 AM
How can you separate a series of numbers into jenks? Shelly Excel Worksheet Functions 9 February 15th 07 07:50 PM
How to separate the numbers and characters in the cell vino Excel Worksheet Functions 3 August 23rd 06 01:47 PM
How to separate numbers from text?? gmoexcel Excel Discussion (Misc queries) 9 March 1st 06 05:50 PM
separate numbers that have a / between them widman Excel Discussion (Misc queries) 4 December 28th 05 10:20 PM


All times are GMT +1. The time now is 07:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"