+ Reply to Thread
Results 1 to 9 of 9

Return all unique values matching 2 criteria but where the data is in multiple columns!

  1. #1
    Registered User
    Join Date
    03-29-2013
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    78

    Return all unique values matching 2 criteria but where the data is in multiple columns!

    Hi All,

    I was just wondering if it is possible to return all unique values matching 2 criteria but where the data from which the unique values are to be taken is across multiple columns??!

    Please see the attached spreadsheet which hopefully shows what I am trying to do.

    I do have the following formula which returns a list of all unique values (in this case ‘Work Types’) from range E5:N16

    =IFERROR(INDEX(AJ_WorkTypes, MIN(IF(COUNTIF(F$5:$F5, AJ_WorkTypes)=0, ROW(AJ_WorkTypes)-MIN(ROW(AJ_WorkTypes))+1)), MATCH(0, COUNTIF(F$5:$F5, INDEX(AJ_WorkTypes, MIN(IF(COUNTIF(F$5:$F5, AJ_WorkTypes)=0, ROW(AJ_WorkTypes)-MIN(ROW(AJ_WorkTypes))+1)), , 1)), 0), 1),"")

    However I would like to tweak it or have a another formula that will return ONLY those Work Types that match Client in column C and Job in column D on the data table.

    All help will be gratefully received.

    Oliver

    P.s. The above formula is stubbornly listing a zero where it finds blanks so if this can also be improved that will be good too.

    Thank you very much!

  2. #2
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: Return all unique values matching 2 criteria but where the data is in multiple columns

    Look attach file summary sheet.
    In this sheet according to criteria "B5" extract data with using index / small / row formula.
    This is a Array formula hence ensure [SHIFT + CTRL +ENTER]


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  3. #3
    Registered User
    Join Date
    03-29-2013
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    78

    Re: Return all unique values matching 2 criteria but where the data is in multiple columns

    Thank you avk.

    I was hoping for a formula to enter in H6 in 'Formulas I am trying to work' sheet and copy down to H25 that would do the job in a single calculation (i.e. no helper tables / columns).

    Although I could do a helper table as you suggest if this is the only way.

    Do you think a single formula in H6 is possible?


    Thank you very much.

  4. #4
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: Return all unique values matching 2 criteria but where the data is in multiple columns

    You can move formula as per requirment.
    No need to helper.
    PHP Code: 
    Do you think a single formula in H6 is possible
    Not understand what you want.
    Any way if your problem resolved then,
    "If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  5. #5
    Registered User
    Join Date
    03-29-2013
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    78

    Re: Return all unique values matching 2 criteria but where the data is in multiple columns

    Sorry but this is not solved.

  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: Return all unique values matching 2 criteria but where the data is in multiple columns

    I am assuming 'Amin' in cell E5 is a typo and should be 'Admin'.

    This is a bit involved. It makes heavy use of Name Manager (to reduce formula bloat) and a re-dimensioning strategy I adapted from Lori here:

    https://excelxor.com/2016/04/08/adva...le-worksheets/

    This named formula I call WorkTypesFilter. It pre-filters the relevant data in AJ_WorkType.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This named formula I call WorkTypes_Addresses. It returns the cell addresses of the relevant AJ_WorkType.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    The final formula is array entered in H6 and filled down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  7. #7
    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: Return all unique values matching 2 criteria but where the data is in multiple columns

    Another way that uses three helper columns.

    In I6 array entered and filled down returns the row numbers for all relevant WorkTypes.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This non array formula in J6 filled down returns all the repeating WorkTypes.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This non array formula in K6 locates those WorkTypes that are unique.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then the final formula in H6
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    03-29-2013
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    78

    Re: Return all unique values matching 2 criteria but where the data is in multiple columns

    Hi Dave,


    Sorry not replied soon. Partly down to time difference and partly down to being at work today!

    Thank you so much for doing this.

    This is VERY impressive to say the least. Wish I had those Excel powers!!


    The first solution is perfect. I did't now Name Manager could be used for packets of formula. I will try and dissect what it is going on here (but suspect I wont get that far!).

    The second solution is also ingenious. I probably would have made a separate table to do a first stage filter and then used my existing 'find all unique values' formula to get down to the final list of unique values. Your helper column solution uses some formulas / methods i'm not familiar with.

    I take it the formulas in F18 and G18 on the 'Table of Data' tab were from your workings and superfluous to requirements now?


    I will now try and copy / adapt these formulas over to my actual spread sheet (with private data) and try to get them to work and in the process hopefully will start to understand some of the logic - if not the actual mechanics.


    Thank you very much again!


    Oliver

    P.s. yes 'Amin' was a typo for 'Admin'

  9. #9
    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: Return all unique values matching 2 criteria but where the data is in multiple columns

    I take it the formulas in F18 and G18 on the 'Table of Data' tab were from your workings and superfluous to requirements now?
    Yes. My apologies. I forgot to clean up after myself.

+ 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: 0
    Last Post: 10-16-2013, 12:42 PM
  2. Replies: 0
    Last Post: 10-07-2013, 10:24 AM
  3. Select multiple criteria based on check box selection and return all unique values.
    By TommyToe in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-21-2013, 09:14 AM
  4. [SOLVED] Return cell values for non-matching & matching criteria
    By jenz_skallemose in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 11-13-2012, 11:52 AM
  5. Count unique values across 2 columns with multiple criteria
    By Skywalker01 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-29-2012, 08:04 AM
  6. matching values based on criteria and return values from another columns
    By lizard54 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2012, 11:29 AM
  7. Replies: 11
    Last Post: 06-09-2011, 03:17 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