Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 14
Default Using text in an IF statement?

Using Excel 2002

This is what I want to do...
A1 = a number or text
A2 = a number
A3 = A1*A2

If A1 is text, what is the correct IF statement in A3 so I don't get
#Value as the answer?

Thanks,
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2,059
Default Using text in an IF statement?

On Jun 12, 9:44*pm, The Hun wrote:
A1 *= *a number or text
A2 *= *a number
A3 *= *A1*A2
If A1 is text, what is the correct IF statement
in A3 so I don't get #Value as the answer?


Depends on what result you want when A1 is text. One way:

=if(istext(A1), "", A1*A2)

Another way:

=n(A1)*A2

If you would like a numerical result when A1 __looks__ like a number,
but is actually text, try:

=if(iserror(A1*A2), "", A1*A2)
  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 109
Default Using text in an IF statement?

What DO you want as an answer if A1 is text?

Try in A3 =IF(ISNUMBER(A1),A1*A2,IF(ISTEXT(A1),""))

George Gee


"The Hun" wrote in message
...
Using Excel 2002

This is what I want to do...
A1 = a number or text
A2 = a number
A3 = A1*A2

If A1 is text, what is the correct IF statement in A3 so I don't get
#Value as the answer?

Thanks,



  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 15,768
Default Using text in an IF statement?

It depends on what result you want when A1 is a text entry.

Start with this and we'll tweak it if needed:

=IF(COUNT(A1),A1*A2,"")

If A1 doesn't contain a number (that also means if A1 is empty) the formula
returns a blank.

--
Biff
Microsoft Excel MVP


"The Hun" wrote in message
...
Using Excel 2002

This is what I want to do...
A1 = a number or text
A2 = a number
A3 = A1*A2

If A1 is text, what is the correct IF statement in A3 so I don't get
#Value as the answer?

Thanks,



  #5   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 14
Default Using text in an IF statement?

On Jun 12, 10:50 pm, "T. Valko" wrote:
It depends on what result you want when A1 is a text entry.

Start with this and we'll tweak it if needed:

=IF(COUNT(A1),A1*A2,"")

If A1 doesn't contain a number (that also means if A1 is empty) the formula
returns a blank.

--
Biff
Microsoft Excel MVP

"The Hun" wrote in message


Thank you. All three of you gave me workable solutions. The answer
to the question each of you asked -- "what result do you want?" -- is
either blank or 0 (zero), and I was able to produce both results from
the answers you gave.

NEW Question: What if I include A4 and A5?

If A4 or A5 is text (such as "no chrg"), what statement in A6 will add
the numbers that remain in A3, A4 or A5 and give me a numerical value
in A6?

A1 = a number or text
A2 = a number
A3 = A1*A2
A4 = a number or text
A5 = a number or text
A6 = TOTAL A3+A4+A5 (and get a numerical value)

Do I have to write nested IF statements in A4 and A5? If I do, I'm
not entirely sure how to do it.

Thanks,


  #6   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 15,768
Default Using text in an IF statement?

Just use a SUM formula:

=SUM(A3:A5)

SUM ignores text.

If there are no numbers then the result will be 0. If you don't want to see
a 0 when no numbers are present then just use the same technique we've shown
you in the other formulas to return a blank instead of a 0.

--
Biff
Microsoft Excel MVP


"The Hun" wrote in message
...
On Jun 12, 10:50 pm, "T. Valko" wrote:
It depends on what result you want when A1 is a text entry.

Start with this and we'll tweak it if needed:

=IF(COUNT(A1),A1*A2,"")

If A1 doesn't contain a number (that also means if A1 is empty) the
formula
returns a blank.

--
Biff
Microsoft Excel MVP

"The Hun" wrote in message


Thank you. All three of you gave me workable solutions. The answer
to the question each of you asked -- "what result do you want?" -- is
either blank or 0 (zero), and I was able to produce both results from
the answers you gave.

NEW Question: What if I include A4 and A5?

If A4 or A5 is text (such as "no chrg"), what statement in A6 will add
the numbers that remain in A3, A4 or A5 and give me a numerical value
in A6?

A1 = a number or text
A2 = a number
A3 = A1*A2
A4 = a number or text
A5 = a number or text
A6 = TOTAL A3+A4+A5 (and get a numerical value)

Do I have to write nested IF statements in A4 and A5? If I do, I'm
not entirely sure how to do it.

Thanks,



  #7   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 14
Default Using text in an IF statement?

Thanks. Everything works now.



On Jun 13, 9:59 am, "T. Valko" wrote:
Just use a SUM formula:

=SUM(A3:A5)

SUM ignores text.

If there are no numbers then the result will be 0. If you don't want to see
a 0 when no numbers are present then just use the same technique we've shown
you in the other formulas to return a blank instead of a 0.

--
Biff
Microsoft Excel MVP

"The Hun" wrote in message

...

On Jun 12, 10:50 pm, "T. Valko" wrote:
It depends on what result you want when A1 is a text entry.


Start with this and we'll tweak it if needed:


=IF(COUNT(A1),A1*A2,"")


If A1 doesn't contain a number (that also means if A1 is empty) the
formula
returns a blank.


--
Biff
Microsoft Excel MVP


"The Hun" wrote in message


Thank you. All three of you gave me workable solutions. The answer
to the question each of you asked -- "what result do you want?" -- is
either blank or 0 (zero), and I was able to produce both results from
the answers you gave.


NEW Question: What if I include A4 and A5?


If A4 or A5 is text (such as "no chrg"), what statement in A6 will add
the numbers that remain in A3, A4 or A5 and give me a numerical value
in A6?


A1 = a number or text
A2 = a number
A3 = A1*A2
A4 = a number or text
A5 = a number or text
A6 = TOTAL A3+A4+A5 (and get a numerical value)


Do I have to write nested IF statements in A4 and A5? If I do, I'm
not entirely sure how to do it.


Thanks,


  #8   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 15,768
Default Using text in an IF statement?

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"The Hun" wrote in message
...
Thanks. Everything works now.



On Jun 13, 9:59 am, "T. Valko" wrote:
Just use a SUM formula:

=SUM(A3:A5)

SUM ignores text.

If there are no numbers then the result will be 0. If you don't want to
see
a 0 when no numbers are present then just use the same technique we've
shown
you in the other formulas to return a blank instead of a 0.

--
Biff
Microsoft Excel MVP

"The Hun" wrote in message

...

On Jun 12, 10:50 pm, "T. Valko" wrote:
It depends on what result you want when A1 is a text entry.


Start with this and we'll tweak it if needed:


=IF(COUNT(A1),A1*A2,"")


If A1 doesn't contain a number (that also means if A1 is empty) the
formula
returns a blank.


--
Biff
Microsoft Excel MVP


"The Hun" wrote in message


Thank you. All three of you gave me workable solutions. The answer
to the question each of you asked -- "what result do you want?" -- is
either blank or 0 (zero), and I was able to produce both results from
the answers you gave.


NEW Question: What if I include A4 and A5?


If A4 or A5 is text (such as "no chrg"), what statement in A6 will add
the numbers that remain in A3, A4 or A5 and give me a numerical value
in A6?


A1 = a number or text
A2 = a number
A3 = A1*A2
A4 = a number or text
A5 = a number or text
A6 = TOTAL A3+A4+A5 (and get a numerical value)


Do I have to write nested IF statements in A4 and A5? If I do, I'm
not entirely sure how to do it.


Thanks,




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
IF Statement with text JustinD[_2_] Excel Worksheet Functions 5 November 20th 07 09:37 AM
If Statement for Text Kehau37 Excel Discussion (Misc queries) 4 October 24th 07 03:41 PM
If Statement - With Formated text Larry L Excel Worksheet Functions 1 June 16th 06 03:00 PM
if statement with text jerry Excel Discussion (Misc queries) 2 June 24th 05 01:21 AM
If statement for text decanno04 Excel Worksheet Functions 2 June 17th 05 12:41 AM


All times are GMT +1. The time now is 02:36 PM.

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"