Computing.Net > Forums > Office Software > newbie question

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

newbie question

Reply to Message Icon

Name: kvw
Date: May 8, 2009 at 19:22:35 Pacific
OS: Windows XP
Subcategory: Microsoft Office
Comment:

I am trying to create an Excel formula unsucessfully.
example:
if cell D4 value is "0" then return "XXX'
if cell D4 value is "*" then return "ZZZ"
if cell D4 is blank then also return "ZZZ"



Sponsored Link
Ads by Google

Response Number 1
Name: Mike (by mmcconaghy)
Date: May 9, 2009 at 09:28:05 Pacific
Reply:

You have pretty well prototyped what you need to do,

If D4 = "0" then "XXX'
if D4 = "*" then "ZZZ"
if D4 = blank "ZZZ"

Now just pop everything into the =IF formula which is
Defined as:

=IF (logical_test, value_if_true, value_if_false)

=IF(D4=0,"xxx",IF(D4="*","zzz",IF(D4=" ","zzz",)))

A comma separates each part of the formula.

MIKE

http://www.skeptic.com/


0

Response Number 2
Name: kvw
Date: May 9, 2009 at 10:10:31 Pacific
Reply:

OK thanks, it works sorta. I had left out some " marks.

If I enter "0" it returns xxx
If I enter "*" it returns ZZZ all good but
If I clear the cell with the delete key it returns xxx
If I clear the cell with the spacebar it returns ZZZ
obviously there must be a difference and a correct way to handle this.

Thanks again,
Ken


0

Response Number 3
Name: Mike (by mmcconaghy)
Date: May 9, 2009 at 10:50:09 Pacific
Reply:

If I clear the cell with the delete key it returns xxx
That because Excel thinks it now contains a zero.......

If I clear the cell with the spacebar it returns ZZZ
That because the "space" is a character........
In the formula D4 = " " there is a space between the quotes.

For more on "blank" Cells in excel:

http://support.microsoft.com/kb/214244

http://excel.tips.net/Pages/T002814...

MIKE

http://www.skeptic.com/


0

Response Number 4
Name: kvw
Date: May 9, 2009 at 12:06:03 Pacific
Reply:

Thanks, that helped me a lot.

ken


0

Response Number 5
Name: DerbyDad03
Date: May 9, 2009 at 14:52:37 Pacific
Reply:

@ Mike

I thought you liked 'em "short and sweet"?

=IF(D4=0,"xxx",IF(OR(D4="*",D4=" "),"zzz"))

7 characters less than your suggestion. <g>


0

Related Posts

See More



Response Number 6
Name: DerbyDad03
Date: May 9, 2009 at 14:55:56 Pacific
Reply:

@ kvw

In the future, please try to use a relevant subject line for your posts.

Something like 'IF statement question" would have been appropriate for this thread.

It helps keep the forum a little more organized and a little easier to search.

Thanks!


0

Response Number 7
Name: Mike (by mmcconaghy)
Date: May 9, 2009 at 18:22:11 Pacific
Reply:

I was just showing how he had it already prototyped
in his question and just illustrated that all he had to do was "plug & play".

I did not think that introducing an OR function into the mix would be helpful at that time, especially if he was having problems understanding an IF.

But, now that he seems to "grok" IF perhaps he can graduate to something a bit more elegant and "shorter"....

MIKE

http://www.skeptic.com/


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: newbie question

excel question - conditional format www.computing.net/answers/office/excel-question-conditional-format/7299.html

n00b form processing(to e-mail) www.computing.net/answers/office/n00b-form-processingto-email/1755.html

Question about Office 2003 Basic www.computing.net/answers/office/question-about-office-2003-basic/4615.html