Get Number From Within Text String

  • Thread starter Thread starter Fellow
  • Start date Start date
F

Fellow

I have cells containing formulas similar to this:
=$B19-$B18+1&" days"
Where B19 and B18 are dates.
Let's say the result of one such cell is "54 days". Is it possible to
somehow ignore "days" and use "54" in another calculation?

Fellow
 
You could give the cell a custom format:

Format|Cells|Number tab|Custom category
General" days"
or
#,##0" days"
 
If the formula is in B20:

=VALUE(SUBSTITUTE(B20," days",""))

HTH,
Bernie
MS Excel MVP
 
I have cells containing formulas similar to this:
=$B19-$B18+1&" days"
Where B19 and B18 are dates.
Let's say the result of one such cell is "54 days". Is it possible to
somehow ignore "days" and use "54" in another calculation?

Fellow

Why not just use:

=$B19-$B18+1

in your other calculation?
--ron
 
We're all glad to help.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
One way
=LEFT(P8,FIND(" ",P8))

Brilliant! Thanks everyone!

-Fellow
 
Back
Top