+ Reply to Thread
Results 1 to 4 of 4

Adding a third variable to an IF statement

  1. #1
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Adding a third variable to an IF statement

    Hi everyone,

    I have the following formula:

    =IF(OR(ISNUMBER(FIND("M",'CORE Data Quarter'!B19)),ISNUMBER(FIND("L",'CORE Data Quarter'!B19))),'CORE Data Quarter'!A19,"")

    What I'm trying to do is add another variable which states if 'CORE Data Quarter'!H19=blank, then 'CORE Data Quarter'!A19,""

    On the flip side, if using the same formula as above, if "CORE Data Quarter'!H19 does not equal blank, then 'CORE Data Quarter'A19,""

    I've tried:

    =IF(AND('CORE Data Quarter'!H19=""),IF(OR(ISNUMBER(FIND("M",'CORE Data Quarter'!B19)),ISNUMBER(FIND("L",'CORE Data Quarter'!B19))),'CORE Data Quarter'!A19,""))

    but i get FALSE for all results.

    Any ideas?

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Adding a third variable to an IF statement

    =IF(OR('CORE Data Quarter'!H19="",ISNUMBER(FIND("M",'CORE Data Quarter'!B19)),ISNUMBER(FIND("L",'CORE Data Quarter'!B19))),'CORE Data Quarter'!A19,"")

    Although your "flip-side" contradicts your new requirement?
    if 'CORE Data Quarter'!H19=blank, then 'CORE Data Quarter'!A19,""
    if "CORE Data Quarter'!H19 does not equal blank, then 'CORE Data Quarter'A19,""

    And I presume you mean if the condition is met, use A19, otherwise use ""?

    Edit: It might be better if you use SEARCH here instead of FIND - FIND is case-sensitive, so "Man" would be true, but "amount" would not
    Last edited by FDibbins; 01-21-2014 at 11:28 AM.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Adding a third variable to an IF statement

    Have I misread?

    If the cell is blank return the value in the cell.

    If the cell isn't blank return the value in the cell.
    If posting code please use code tags, see here.

  4. #4
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Adding a third variable to an IF statement

    Hi everyone,

    Sorry, I didn't explain clearly. The "flip side" argument is for a different sheet that had other pre-existing criteria. In any case I think I've figured it out. Thanks for the responses everyone!

+ 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: 4
    Last Post: 07-12-2013, 12:14 PM
  2. [SOLVED] For Next Statement with If Statement Reducing Upper Variable
    By Break_Point in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-28-2013, 06:30 PM
  3. [SOLVED] adding a variable filename into a SQL Select Statement in MailMerge - Help
    By timmrowe in forum Word Formatting & General
    Replies: 1
    Last Post: 01-07-2013, 02:55 PM
  4. [SOLVED] Adding an if statement to vba and adding 1 onto the cell value
    By Nicola13 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-21-2012, 05:13 AM

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