+ Reply to Thread
Results 1 to 6 of 6

Doubt with Array formula - Can it be preceeded by an "IF"?

  1. #1
    Forum Contributor
    Join Date
    05-03-2013
    Location
    Costa Rica
    MS-Off Ver
    MS Excel 365
    Posts
    120

    Doubt with Array formula - Can it be preceeded by an "IF"?

    hi there!

    I have this doubt.

    Look at this formula:

    =IF(C1=0,””,C1)

    This formula commands Excel to return nothing if cell C1 is empty; otherwise the result should be the content of cell C1.

    Can I use a similar formula to command Excel to return nothing if an array formula returns "0" as the result? I mean something like this:

    =IF(Array formula =0,"",Array formula)

    The array formula I am using is this one:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If this is possible, I don't know what the syntax would be to write the formula, or when I should click CTL+SHIFT+ENTER to activate the array formula if it is preceeded by an "IF".

  2. #2
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: Doubt with Array formula - Can it be preceeded by an "IF"?

    at a glance that looks like it should work to me... did you try it and it's not working?
    Hope I could help - if your post has been solved don't forget to mark it as such.

    Clicking the * below is a great way to say thanks!

    "Drowning in 10 feet of water isn?t any different than drowning in a million feet. And if you can swim, it doesn?t matter how deep the ocean is. At some level, once you realize you?re in water that?s too deep to stand, you have to have a very different approach," - Joi Ito

  3. #3
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: Doubt with Array formula - Can it be preceeded by an "IF"?

    Have you not tried amending your current array formula to exclude zeros in the SMALL result? Maybe something like:

    Please Login or Register  to view this content.
    Spread the love, add to the Rep

    "None of us are as smart as all of us."

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Doubt with Array formula - Can it be preceeded by an "IF"?

    Quote Originally Posted by alchavar View Post
    =IF(C1=0,””,C1)

    This formula commands Excel to return nothing if cell C1 is empty
    That's not exactly true.
    It returns nothing if C1 equals Zero.
    It just so happens that it will consider an empty cell as 0, so it works as you intend.
    But strictly speaking it's also going to return the "" if C1 contains the numerical value of Zero.

    Anyway..

    Yes, you can wrap your existing Array formula in an IF to test it's result for 0.
    FYI, your array formula is already in an IF..Testing if it's result is an error (IF(ISERROR(...)
    The array portion of your formula is just this part
    INDEX($A$1:$B$10000,SMALL(IF($A$1:$A$10000=E$1,ROW($A$1:$A$10000)),ROW(1:1)),2)

    To test it for 0, try
    =IF(ISERROR(INDEX($A$1:$B$10000,SMALL(IF($A$1:$A$10000=E$1,ROW($A$1:$A$10000)),ROW(1:1)),2)),"",IF(INDEX($A$1:$B$10000,SMALL(IF($A$1:$A$10000=E$1,ROW($A$1:$A$10000)),ROW(1:1)),2)=0,"",INDEX($A$1:$B$10000,SMALL(IF($A$1:$A$10000=E$1,ROW($A$1:$A$10000)),ROW(1:1)),2)))

  5. #5
    Forum Contributor
    Join Date
    05-03-2013
    Location
    Costa Rica
    MS-Off Ver
    MS Excel 365
    Posts
    120

    Re: Doubt with Array formula - Can it be preceeded by an "IF"?

    Thanks all of you who responded!

    Though the answer from "mcmahobt" makes sense, I tried using the answer of "Jonmo1" shown above in order to wrap my array formula in an IF to test its result for 0, and it worked.

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Doubt with Array formula - Can it be preceeded by an "IF"?

    You're welcome.

+ 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: 7
    Last Post: 04-11-2013, 12:46 AM
  2. Replies: 5
    Last Post: 10-12-2010, 06:46 AM
  3. [SOLVED] Re: macro for converting number stored as "text" (or preceeded with ') to "number" formatting
    By markx in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-30-2006, 07:14 AM
  4. [SOLVED] macro for converting number stored as "text" (or preceeded with ') to "number" formatting
    By markx in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-23-2006, 10:20 AM
  5. [SOLVED] If changed array formula reduce ""\""\""\ - signs to #Missing, will it make ...
    By Maria J-son in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-05-2006, 08:25 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