View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
David Biddulph[_2_] David Biddulph[_2_] is offline
external usenet poster
 
Posts: 8,651
Default Find text, then calculate

My guess is that the content of your cell isn't what you've said it is.
Perhaps you've got leading or trailing spaces, or some other non-printing
characters?
What does =LEN(A2) return? Should be 5 for the 1 Gal and 5 Gal cases and 4
for the 1Qt.
--
David Biddulph

"Teatro" wrote in message
...
Still only get either "invalid input" (from your formula) or FALSE (when I
remove the invalid input text). The cell references you have listed are
correct, as is the text, but I still can't get it to work except to return
FALSE (even when it finds the 5 Gal or the 1 Qt in the text).

"David Biddulph" wrote:

=IF(A2="1 Gal",D2,IF(A2="5 Gal",D2/5,IF(A2="1 Qt",D2*4,"invalid input")))
--
David Biddulph

"Teatro" wrote in message
...
I have a spreadsheet that has 3 sizes in a text string in cells. For
example,
A2 may have 1 Gal, A3 may have 1 Qt and A4 may have 5 Gal.

I want to create an IF statement that looks for those sizes in the
Column
A,
and if it finds either 1 Qt or 5 Gal, I want it to take the quantity in
column D and divide by 5 for the 5 gal and multiply by 4 for the 1 Qt.
(I'm
trying to convert everything to gallons).

I've tried multiple formulas, but the best I can do is have it report
true
or false.

TIA.