Get Number From Within Text String

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
 
D

Dave Peterson

You could give the cell a custom format:

Format|Cells|Number tab|Custom category
General" days"
or
#,##0" days"
 
B

Bernie Deitrick

If the formula is in B20:

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

HTH,
Bernie
MS Excel MVP
 
R

Ron Rosenfeld

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
 
D

Don Guillett

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top