Excel If Then Statements - DonationCoder.com
Welcome Guest. August 29, 2015, 08:35:07 PM

Or did you miss your validation email?

Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.

 You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 Check out and download the GOE 2007 Freeware Challenge productivity tools. Entire Forum This board This topic Members Help Desk Entire Site
Pages: [1]   Go Down
 Reply  |  New Topic  |  Print
 Author Topic: Excel If Then Statements  (Read 4228 times)
Mizraim
Supporting Member

Posts: 150

 « on: March 21, 2009, 11:10:01 AM »

I've searched a few sites for help on this matter, with no luck. So I figured I'd come ask you smart folks if you know what I'm doing wrong.

IF Cell D2 has the value "Fire" THEN Cell F2 receives "NW" AND Cell G2 receives "W", ELSE Put nothing in the box, shown in my code below

=if((D2="Fire"),F2="NW"&G2="W","")

However, I always get "False" Returned to the cell I put this code into.

 Logged

Mizraim
Supporting Member

Posts: 150

 « Reply #1 on: March 21, 2009, 11:43:03 AM »

I figured it out, thanks to the help from my brother. I was taking the IF statement out too far. In an IF, there can only be 3 parts, the STATEMENT, the TRUE and the FALSE. I was adding 4.

=IF(D2="Fire",            "NW",         IF(D2="Wind","SE","")) is correct,
1                      2                       3

=IF(D2="Fire",            "NW",          "",             IF(D2="Wind",SE,"")) was incorrect
1                       2             3                               4

However, I am still unable to edit multiple cells in the same statement...

This was done from Cell F2:

=IF(D2="Fire","NW"&G2="W",IF(D2=...

Now it fills the G2 Cell with W and leaves False in F2.

Any pointers?
 « Last Edit: March 21, 2009, 11:48:11 AM by Mizraim » Logged

AndyM
Charter Member

Posts: 616

 « Reply #2 on: March 21, 2009, 07:41:54 PM »

Quote
However, I am still unable to edit multiple cells in the same statement...

This was done from Cell F2:

=IF(D2="Fire","NW"&G2="W",IF(D2=...

Now it fills the G2 Cell with W and leaves False in F2.

To have G2 display something using a formula, you have to put a formula in G2.  I can't see how a formula in F2 would "fill the G2 Cell with W" unless you had a formula in G2 testing for the contents of F2 or D2.

The only way something in F2 can change the contents of G2 independent of what's already in G2, like a formula, is with an event macro.
 Logged
Supporting Member

Posts: 1

 « Reply #3 on: March 21, 2009, 11:47:15 PM »

Try the following formulas:

In F2, type: =if(d2="fire","NW","")

In G2, type: =if(d2="fire","W","")
 Logged
Pages: [1]   Go Up
 Reply  |  New Topic  |  Print