+ Reply to Thread
Results 1 to 7 of 7

Adding IF to an Array formula

  1. #1
    Forum Contributor
    Join Date
    02-09-2011
    Location
    Perth, Australia
    MS-Off Ver
    2016
    Posts
    161

    Adding IF to an Array formula

    Hi,

    The array formula below returns a value in Column B that corresponds to a match for "X" in Column A. If the value in Col A is not "X" a blank cell is returned, as intended. The problem is that when an "X" in Col A has a corresponding empty cell in Col B, a 0 (zero) is returned. How can I have a blank cell (" ") returned instead of the zero. I think it needs another IF but can't figure out how to do it in an array formula.


    {=IF(Sheet2!A$2:A$7="X",Sheet2!B$2:B$7, " ")}


    Thanks very much

    Dave

  2. #2
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Adding IF to an Array formula

    Hi,

    May be this?

    {=IF(IF(Sheet2!A$2:A$7="X",Sheet2!B$2:B$7, " ")=0,"",IF(Sheet2!A$2:A$7="X",Sheet2!B$2:B$7, " "))}

  3. #3
    Forum Contributor
    Join Date
    02-09-2011
    Location
    Perth, Australia
    MS-Off Ver
    2016
    Posts
    161

    Re: Adding IF to an Array formula

    Thanks, I will give it a try

    Dave

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,363

    Re: Adding IF to an Array formula

    format as

    0;-0;;@

  5. #5
    Forum Contributor
    Join Date
    02-09-2011
    Location
    Perth, Australia
    MS-Off Ver
    2016
    Posts
    161

    Re: Adding IF to an Array formula

    Yes, it works. Thanks very much

  6. #6
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Adding IF to an Array formula

    You are welcome

    If that takes care of your question, please mark this thread as Solved by selecting Thread Tools --> Mark thread as solved.

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Adding IF to an Array formula

    Quote Originally Posted by Motox View Post
    {=IF(Sheet2!A$2:A$7="X",Sheet2!B$2:B$7, " ")}
    Your formula returns a space character, not a formula blank. A formula blank would be:

    {=IF(Sheet2!A$2:A$7="X",Sheet2!B$2:B$7,"")}
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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. Adding an extra layer to this array formula
    By liquidmettle in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-04-2015, 04:46 PM
  2. Need help adding a new row at the bottom and filling it with an array formula
    By anthonyk32792 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-26-2015, 01:34 PM
  3. [SOLVED] Adding Calendar range to Array formula
    By Ebo12 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-04-2015, 12:29 PM
  4. Employee grouping, adding to an array formula.
    By nickmessick1 in forum Excel General
    Replies: 2
    Last Post: 06-28-2013, 11:31 AM
  5. adding Indirect formula to my current sum if array formula
    By Eastbay2 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-13-2013, 09:41 AM
  6. Adding Array Large Formula To Cell Via VBA
    By realniceguy5000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-29-2011, 02:45 PM
  7. Help adding IF ISNUMBER in Proper location in Array Formula
    By fridgeymonster3 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-06-2011, 01:00 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