+ Reply to Thread
Results 1 to 14 of 14

Find a column reference for a cell meeting 2-dimensional criteria

  1. #1
    Registered User
    Join Date
    09-03-2013
    Location
    Minnesota
    MS-Off Ver
    Excel MAC 2011
    Posts
    7

    Question Find a column reference for a cell meeting 2-dimensional criteria

    Hello! I have been trying to do this for many days now, and so finally decided to join this forum and ask for help.

    I am trying to get the column number of a cell that meets both vertical and horizontal criteria within a matrix.

    Specifically I am trying to produce a formula that will give me the column number of a column that both includes the number 1 and has a specific REF #

    Example:

    (REF #) (1/4/13) (12/4/12) (7/18/13)
    (1) (1) (0) (0)
    (2) (0) (0) (1)
    (3) (0) (1) (0)

    Untitled copy.jpg


    The reason I am looking to do this is to produce an OFFSET function that will utilize this column number to give me the heading title (Date) for different REF #s corresponding to where the number 1 is located.

    Any tips will help! I've tried using combinations of IF, OR, AND, SUMPRODUCT, VLOOKUP, HLOOKUP, OFFSET, INDEX, COLUMN, and MATCH but can't seem to quite figure it out

    ~Charlie
    Last edited by crazytalker90; 09-03-2013 at 06:30 PM. Reason: (add photo)

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Find a column reference for a cell meeting 2-dimensional criteria

    Without seeing your file, i think the solution will be index/match
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    09-03-2013
    Location
    Minnesota
    MS-Off Ver
    Excel MAC 2011
    Posts
    7

    Re: Find a column reference for a cell meeting 2-dimensional criteria

    @oeldere, thanks for the heads up, I uploaded a picture of a simplification of my data file, does that help? I want to output the column number where a 1 is listed within the matrix that corresponds to a given REF # (note: REF #s do not necessarily go in order so I need to be able to look up the row based on the REF # and then look up the column based on its matrix value)

    ~Charlie

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Find a column reference for a cell meeting 2-dimensional criteria

    In a picture we can't work to test the solution.

    Please add an excel file, without confidential information (and please add the desired result).

  5. #5
    Registered User
    Join Date
    09-03-2013
    Location
    Minnesota
    MS-Off Ver
    Excel MAC 2011
    Posts
    7

    Re: Find a column reference for a cell meeting 2-dimensional criteria

    Okay, thanks for your guidance. Here is a simplified file of what I am trying to accomplish

    Thanks!

    ~Charlie

    simplified file.xlsx

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Find a column reference for a cell meeting 2-dimensional criteria

    With the macro below.

    It seems a bit of overkill, but I don't have another solution.

    See the attached file.

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    09-03-2013
    Location
    Minnesota
    MS-Off Ver
    Excel MAC 2011
    Posts
    7

    Re: Find a column reference for a cell meeting 2-dimensional criteria

    Thanks @oeldere! Do you know if there's a way to accomplish this with formulas alone and not with any macros? I will be sharing this file with others and I would be afraid the macro would be lost in the shuffle

    ~Charlie

    ~Charlie
    Last edited by crazytalker90; 09-04-2013 at 04:41 PM.

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Find a column reference for a cell meeting 2-dimensional criteria

    I don't used formula's.

    Instead I used the code (macro), which you will find in #6.

    Please reply, if the result is, as you liked (desired) (expected).

  9. #9
    Registered User
    Join Date
    09-03-2013
    Location
    Minnesota
    MS-Off Ver
    Excel MAC 2011
    Posts
    7

    Re: Find a column reference for a cell meeting 2-dimensional criteria

    Thanks @oeldere! Looks great. Also, do you know happend to know if there's a way to accomplish this with formulas alone and not with any macros? I will be sharing this file with others and I would be afraid the macro would be lost in the shuffle

    ~Charlie

  10. #10
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Find a column reference for a cell meeting 2-dimensional criteria

    Maybe my quote in #6 explain it all.

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    09-03-2013
    Location
    Minnesota
    MS-Off Ver
    Excel MAC 2011
    Posts
    7

    Re: Find a column reference for a cell meeting 2-dimensional criteria

    Ah, gotcha, well thanks for your help @oeldere!

    ~Charlie

  12. #12
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Find a column reference for a cell meeting 2-dimensional criteria

    Thanks for the reply.

    Glad I could help.

  13. #13
    Registered User
    Join Date
    09-03-2013
    Location
    Minnesota
    MS-Off Ver
    Excel MAC 2011
    Posts
    7

    Smile Re: Find a column reference for a cell meeting 2-dimensional criteria

    Hey @oeldere! Thought you might be interested, someone in another forum answered my post as well and gave the formula

    "Let A:D house the above sample.

    Let F2 house 3, a REF # of interest.

    G2, just enter:

    =MATCH(1,INDEX($B$2:$D$4,MATCH($F2,$A$2:$A$4,0),0),0)

    If you want the date in the headers row...

    =INDEX($B$1:$D$1,MATCH(1,INDEX($B$2:$D$4,MATCH($F2,$A$2:$A$4,0),0),0))


    Duplicate records change the nature of the task (if more than one REF# present in column A):

    G2, control+shift+enter, not just enter:
    Code:
    =MIN(IF(IF($A$2:$A$5=$F2,$B$2:$D$5)=1,$B$1:$D$1)
    )

    Thought this may be of interest! All the best

    ~Charlie

    (from http://www.mrexcel.com/forum/excel-q...ml#post3567302 )

  14. #14
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Find a column reference for a cell meeting 2-dimensional criteria

    Thanks for sharing.

+ 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] How can a find the row number of a row meeting specified criteria?
    By satania in forum Excel General
    Replies: 2
    Last Post: 05-29-2012, 10:12 AM
  2. Counting unique column entries while also meeting other criteria
    By Mom2a* in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 02-04-2012, 05:21 AM
  3. Sum one column meeting criteria from two other columns
    By ddalferes in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 12-22-2011, 03:10 PM
  4. need to sum third column if meeting 2 different criteria
    By hydro in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-27-2011, 04:28 PM
  5. Replies: 6
    Last Post: 09-30-2009, 12:05 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