+ Reply to Thread
Results 1 to 6 of 6

IFS test Array

  1. #1
    Registered User
    Join Date
    02-14-2011
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    20

    IFS test Array

    Hello, Excel Gurus:

    Please help on this one!!

    I have six columns of data (A1:F1). I’m trying to use the IFS function in G1:L1.

    1. I entered in Column G1:L1 the IFS function: =IFS(A1=$O$2:$O$8,$O$1,A1=$P$2:$P$8,$P$1,A1=$Q$2:$Q$8,$Q$1,A1=$R$2:$R$6,$R$1)

    2. I have a named range in O2:O8 with the number 1 in O1.
    3. I have a named range in P2:P8 with the number 2 in P1.
    4. I have a named range in Q2:Q8 with the number 3 in Q1.
    5. I have a named range in R2:8R with the number 4 in R1.


    I’m trying to get the formula to look in those (4) named range’s and if it’s in that individual range put the number of that range that is in O1:R1 into that cell. In my example worksheet it seems sometimes it work.


    Please Help when you can. Thanks, in advanced
    Attached Files Attached Files

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: IFS test Array

    Try wrapping LOOKUP around your IFS formula.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Although this is all around easier.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by FlameRetired; 02-06-2020 at 12:13 AM.
    Dave

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,600

    Re: IFS test Array

    Try Reverse lookup:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by protonLeah; 02-06-2020 at 12:25 AM.
    Ben Van Johnson

  4. #4
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: IFS test Array

    You don't need IFS. If you're really using Excel 2019, this should work.

    G1: =IFS(OR(A1=$O$2:$O$8),$O$1,OR(A1=$P$2:$P$8),$P$1,OR(A1=$Q$2:$Q$8),$Q$1,OR(A1=$R$2:$R$6),$R$1)

    This is a little inefficient. More efficient but longer would be

    G1: =IFERROR($O$1/SIGN(MATCH(A1,$O$2:$O$8,0)),IFERROR($P$1/SIGN(MATCH(A1,$P$2:$P$8,0)),IFERROR($Q$1/SIGN(MATCH(A1,$Q$2:$Q$8,0)),
    IFERROR($R$1/SIGN(MATCH(A1,$R$2:$R$6,0)),"--"))))

    ADDED: Had to see how spilled formulas/dynamic arrays could handle this.

    G1: =INDEX($O$1:$R$1,1+MOD(MATCH(A1,INDEX($O$2:$R$8,1+MOD(SEQUENCE(26,1,0),7),1+INT(SEQUENCE(26,1,0)/7)),0)-1,4))

    This should be more efficient than lots of OR calls. The inner INDEX call reshapes O2:R8 into a 26-row x 1-column array, then matches against that.
    Last edited by hrlngrv; 02-06-2020 at 01:11 AM.

  5. #5
    Registered User
    Join Date
    02-14-2011
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    20

    Re: IFS test Array

    Thanks! I tested and use all three in my workbook and they all worked great. Amazing work with quick reply.

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: IFS test Array

    You are welcome. Glad to help, and thank you for the feedback added rep and marking your thread Solved.

+ 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. [SOLVED] What array is the first and what is the second in F-Test function?
    By GIS2013 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-31-2013, 09:51 AM
  2. Need to test an array for values
    By bill286az in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-20-2013, 12:48 AM
  3. Replies: 2
    Last Post: 05-31-2010, 12:06 PM
  4. Array Function test not working
    By Phil_V in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 08-07-2009, 06:38 AM
  5. Can't test for Empty objects in an array
    By Peter Chatterton in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-28-2005, 03:05 AM
  6. [SOLVED] Test for dups in Array
    By Perico in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-14-2005, 05:05 AM
  7. [SOLVED] Array Test
    By VBA Dabbler in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-30-2005, 05:06 PM
  8. [SOLVED] Test for end of array of objects?
    By peter in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-03-2005, 09:06 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