Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Can I use words and numbers in the same cell in a formula?

For example:

I want column A to read "5 gal" and column B read "$25.00" and column C=A/B.
But when I enter that formula it won't compute beause in column A i have
"gal". I know an easy solution would be to add another column to read the
"gal" but I would really like to find a way to only have the 3 columns.

Any help please would be greatly appreciated. Thank you!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 348
Default Can I use words and numbers in the same cell in a formula?

CarJO129 wrote:
For example:

I want column A to read "5 gal" and column B read "$25.00" and column C=A/B.
But when I enter that formula it won't compute beause in column A i have
"gal". I know an easy solution would be to add another column to read the
"gal" but I would really like to find a way to only have the 3 columns.

Any help please would be greatly appreciated. Thank you!


An easy way is to use column headers, where A1=Amount(gal) , B1=Price,
and C1=$/gal. And perhaps your formula should be C=B/A unless you really
do want gallons per dollar.
Then you only have to enter the number in the rest of the column and
save typing four characters -- the space is also a character -- for each
entry.
Otherwise your formula for column C is going to get a lot more complicated.
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Can I use words and numbers in the same cell in a formula?

hi
yes but you would have to use a more complicated formula.
with words and numbers in a cell, excel treats in a all text ie no math
possible so what you have to do is pick out the number.
to pick out the 5 from 5 gals use this formula
=left(A2,1)
so that your intire formula would be...
=left(A2,1)/B2
the above left formula only pick out 1 digit so if you have more that one
digit, say, 10 gal, then you would have to modify the left formula to
compensate. or expand the formula.....
=left(A2,find(" ",A2,1))/B2
the above formula searches for a space and picks out all preceding numbers
before the space.
read up on the left and find functions in excel help. also look at the right
and mid functions.

Regards
FSt1

"CarJO129" wrote:

For example:

I want column A to read "5 gal" and column B read "$25.00" and column C=A/B.
But when I enter that formula it won't compute beause in column A i have
"gal". I know an easy solution would be to add another column to read the
"gal" but I would really like to find a way to only have the 3 columns.

Any help please would be greatly appreciated. Thank you!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Can I use words and numbers in the same cell in a formula?

Click on A1 and:

Format Cells... Number Custom General" gal"

then all you have to enter in A1 is:
5
--
Gary''s Student - gsnu200909


"CarJO129" wrote:

For example:

I want column A to read "5 gal" and column B read "$25.00" and column C=A/B.
But when I enter that formula it won't compute beause in column A i have
"gal". I know an easy solution would be to add another column to read the
"gal" but I would really like to find a way to only have the 3 columns.

Any help please would be greatly appreciated. Thank you!

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default Can I use words and numbers in the same cell in a formula?

You can return the leading number from a cell containing a number followed
by some text using this...

LOOKUP(9.9E+307,--LEFT(A1,ROW($1:$99)))

So, for your formula (assuming Row 1), this should work...

C1: =LOOKUP(9.9E+307,--LEFT(A1,ROW($1:$99)))/B1

--
Rick (MVP - Excel)


"CarJO129" wrote in message
...
For example:

I want column A to read "5 gal" and column B read "$25.00" and column
C=A/B.
But when I enter that formula it won't compute beause in column A i have
"gal". I know an easy solution would be to add another column to read the
"gal" but I would really like to find a way to only have the 3 columns.

Any help please would be greatly appreciated. Thank you!




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Can I use words and numbers in the same cell in a formula?

Custom format A to 0" gal"


Gord Dibben MS Excel MVP


On Tue, 29 Dec 2009 09:51:01 -0800, CarJO129
wrote:

For example:

I want column A to read "5 gal" and column B read "$25.00" and column C=A/B.
But when I enter that formula it won't compute beause in column A i have
"gal". I know an easy solution would be to add another column to read the
"gal" but I would really like to find a way to only have the 3 columns.

Any help please would be greatly appreciated. Thank you!


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
recognizing words as numbers...for a formula CONFUSED Excel Worksheet Functions 2 June 4th 09 02:27 AM
Help! Array formula for data that uses words instead of numbers cecij22 Excel Discussion (Misc queries) 4 September 8th 08 07:22 PM
Can I have words representing numbers in a formula? PeterM Excel Discussion (Misc queries) 4 August 7th 06 09:29 PM
IF formula in Excel / Replace numbers with 'words' Emsmaps Excel Discussion (Misc queries) 1 April 7th 06 11:01 PM
new sheet the cell doesn't let me type words & numbers excel general question Excel Discussion (Misc queries) 1 November 11th 05 03:25 PM


All times are GMT +1. The time now is 08:20 AM.

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

About Us

"It's about Microsoft Excel"