View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Steve Steve is offline
external usenet poster
 
Posts: 1,814
Default Convert variable #'s in a gen. format to a # that can be used

This produced :6
I changed the 3's to 2's and got the 6, but I don't think my fix will
account for 2 or 3 digit numbers, will it ? Same as other, taking a number in
cell E19, and dividing by the resulting 6, still produces a #value!


"Glenn" wrote:

Yes, A1 should have "Period: 01/23/2010 to 01/29/2010 - Days: 6". You
probably have trailing spaces in your data, which could cause the #Value! error.
Try this instead:

B1 =--RIGHT(SUBSTITUTE(TRIM(A1)," ",REPT(" ",3)),3)

Steve wrote:
I'm getting a #value!
A1 is where my general format data is, correct ?

"Glenn" wrote:

Steve wrote:
I have this data that is pasted to my worksheet:

Period: 01/23/2010 to 01/29/2010 - Days: 6
It is in general format. The day numbers will always be in the last, last 2
, or last 3 positions.
Depending on the period, the days may be any # up to the 365.
I need to use that day #, be it 6, or 25, or 147, whatever, as a divisor of
another number. E.g. if 6, then 1234 / 6 = 206
if 25, then 5678 / 25 = 227, etc/
The variable #'s will be in the same cell, so I basically want: E29/6 or
E29/25, or E29/147, etc.
Basically, those general formatted #'s converted to a usable/divisable #.

Thanks,

Steve



One way:

=--TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",10)),10))
.

.