+ Reply to Thread
Results 1 to 9 of 9

If statement formula help!

  1. #1
    Registered User
    Join Date
    07-23-2021
    Location
    USA
    MS-Off Ver
    2016
    Posts
    32

    If statement formula help!

    Hello, per attached image, I have 4 columns below. I need to devise an IF statement based on three conditions also below. Table sample also attached. thank you.

    Column A - STATE (SOURCE 1)
    Column B - STATE (SOURCE 2)
    Column C - MATCH (A simple IF STATEMENT to see if cells in columns A & B match)
    Column D - STATE_FINAL (final return value based on conditions below)

    Condition 1 (true match per column C): Return value from Column B cell if value in cells in column A &B match
    Condition 2 (false match per column C) : Return value from Column B cell if value in column A cell is 0
    Condition 3 (false match per column C) : Return value from Column A cell if value in column B cell is 0

    Excel_IFSTATEMENTHELP.png

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,463

    Re: If statement formula help!

    Try this in D2 (untested, as you did not supply a sample Excel workbook):

    =IF(C2,B2,IF(AND(A2=0,B2=0),"",IF(A2=0,B2,A2)))

    Copy down as required. I have assumed that you want blank to be returned if both A and B are zero. I also assume that you forgot to change the A2 and B2 references in your comments for rows 3 and 4.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    07-23-2021
    Location
    USA
    MS-Off Ver
    2016
    Posts
    32

    Re: If statement formula help!

    Thank you so much for quick reply. To clarify, I would like non-zero values returned if the other neighboring cell is 0. Also you are correct on last statement. Please see revised conditions required. Can you offer a solution around this revision?

    -return value from cell b2 if A2 & B2 match
    -return value from cell b3 if A3 is 0
    -return value from cell A4 if B4 is 0

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,463

    Re: If statement formula help!

    Did you try my proposed solution? It should give you what you have stated in your revised conditions.

    Pete

  5. #5
    Registered User
    Join Date
    07-23-2021
    Location
    USA
    MS-Off Ver
    2016
    Posts
    32

    Re: If statement formula help!

    Yes it returns 0 when formula is applied for a scenario seen in row 3 but would like 'NEw York' value returned

  6. #6
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,725

    Re: If statement formula help!

    Or use this formula
    Please Login or Register  to view this content.
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  7. #7
    Registered User
    Join Date
    07-23-2021
    Location
    USA
    MS-Off Ver
    2016
    Posts
    32

    Re: If statement formula help!

    sorry that is not working either...

  8. #8
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,725

    Re: If statement formula help!

    Then take a look at this both formulas work
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    07-23-2021
    Location
    USA
    MS-Off Ver
    2016
    Posts
    32

    Re: If statement formula help!

    YES it worked!!! Thank you all so much for this!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 12-19-2022, 11:52 AM
  2. translate an ifs statement into an if statement - one formula
    By Excelnew200 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-10-2019, 11:37 AM
  3. [SOLVED] Evaluating the results of a formula within an IF() statement, without duplicating formula?
    By hardofhearing in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-29-2018, 01:08 PM
  4. [SOLVED] IF statement clause and SUMIF statement formula help!!!!
    By djmatok in forum Excel Formulas & Functions
    Replies: 28
    Last Post: 10-28-2015, 04:48 PM
  5. [SOLVED] Glitched formula? IF statement does not work because of a formula in a reference cell
    By Tworksheets in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-04-2013, 02:16 PM
  6. [SOLVED] Formula for Income Statement in financial statement
    By Zunit in forum Excel General
    Replies: 6
    Last Post: 07-02-2012, 02:21 PM
  7. Replies: 1
    Last Post: 07-20-2006, 03:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1