+ Reply to Thread
Results 1 to 5 of 5

array within an array to discount selected items from formula

  1. #1
    Registered User
    Join Date
    05-25-2016
    Location
    Cardiff, Wales
    MS-Off Ver
    excel 2010
    Posts
    2

    array within an array to discount selected items from formula

    Hi there,

    i have a formula that current looks like this:
    ={MAX(IF((AreaCode=$T$3)*(SampleType=$C$1)*(ParamCode=$B7)*OR(LocationCode<>{"GW37","GW33","GW41","GW31"})>0,Unxtab_RAWData!$R$2:$R$34999))}

    the idea being is searches through the data which has ~35000 rows, and provides the max for a column when in accordance with the criteria. It worked fine before, however the bit I have just added in is the "LocationCode" selection highlighted in bold, as i need to remove some points (the ones with location IDs GW37,GW33,GW41,GW31). However, this bit isn't working and the values for these locations are still being summarised (or maxed) in by data.

    does anyone have an idea of where i'm going wrong?

    thanks

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,698

    Re: array within an array to discount selected items from formula

    Change the OR to AND.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    05-25-2016
    Location
    Cardiff, Wales
    MS-Off Ver
    excel 2010
    Posts
    2

    Re: array within an array to discount selected items from formula

    Hi - no afraid that doesn't work. Each line will only have one of the IDs present. So one row may have GW41 (it wont have any of the other IDs). the IDs are all in one column.

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,899

    Re: array within an array to discount selected items from formula

    Try this ...

    =MAX(IF((AreaCode=$T$3)*(SampleType=$C$1)*(ParamCode=$B7)*(LocationCode<>"GW37")*(LocationCode<>"GW33")
    *((LocationCode<>"GW41")*(LocationCode<>"GW31")>0,Unxtab_RAWData!$R$2:$R$34999))
    Last edited by Phuocam; 05-26-2016 at 07:17 AM.

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,698

    Re: array within an array to discount selected items from formula

    Quote Originally Posted by Hub101 View Post
    Hi - no afraid that doesn't work. Each line will only have one of the IDs present. So one row may have GW41 (it wont have any of the other IDs). the IDs are all in one column.
    Did you try it?

    The OR part that you have means "If LocationCode <> GW37 OR LocationCode <> GW33 OR....."

    This will always be TRUE. LocationCode has one value so will always be not equal to at least three of the values in the list.

    The logic you want is that LocationCode is not equal to any of them, which is "If LocationCode <> GW37 AND LocationCode <> GW33 AND....."

    If you still don't have a solution, can I ask that you attach your file so we can see what your data looks like? How is LocationCode defined? Even if you blank out the data leaving headers, we can see what the layout is.

+ 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. Array formula to return list of unique items from selected columns only
    By jlawton1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-23-2016, 04:53 AM
  2. [SOLVED] [SOLVED} array of discount multiply to array of amount
    By kirby21 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-03-2014, 11:31 PM
  3. [SOLVED] Can't populate an array with selected items from listbox
    By jamesdeuce in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-16-2014, 09:57 PM
  4. [SOLVED] Using an array to create a list of selected items
    By Harribone in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-02-2014, 04:40 PM
  5. [SOLVED] Populating an array with selected ListBox items
    By wz4np1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-13-2012, 07:52 AM
  6. [SOLVED] Fill Array from Selected Items in Text Box
    By John Michl in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-05-2006, 09:15 AM
  7. ListBox Selected Items into an Array
    By jtp550 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-27-2005, 07:44 PM

Tags for this Thread

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