+ Reply to Thread
Results 1 to 7 of 7

Matching values between array and matrix

  1. #1
    Registered User
    Join Date
    09-03-2019
    Location
    Portugal
    MS-Off Ver
    2016
    Posts
    2

    Matching values between array and matrix

    Hi everyone,

    I'm not sure if this is simple and I'm just complicating things but here it goes.

    I have this raw data format where each column represents a variable (there are many but I'll just write one for simplicity) and each row an occurrence (it's actually a respondent in a survey)
    My objective is to count how many a's and b's and so on exist in each variable
    variable 1
    a,b,c,d
    b,d
    a,b,d

    So I thought that maybe I could create 4 columns under variable 1 with headers a b c and d, perform a text to columns separated by a comma and then verify if occurance x has any a, b, c or d
    The problem is that the a,b,c and d will not match the headers because they are not ordered correctly, so I don't know what kind of function I could apply here!
    e.g.:

    a b c d
    a b c d
    b d
    a b d


    Do you have any suggestion? Sorry but I'm struggling in explaining the problem any better, that's how lost I am.
    Last edited by AliGW; 09-04-2019 at 01:39 AM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Finding values in a matrix

    It would help if you attached a sample Excel workbook.

    To do this, click on Go Advanced (below the Edit Window) while you are composing a reply, then scroll down to and click on Manage Attachments and the Upload window will open. Click on Browse and navigate to (and double-click) the file icon that you want to attach, then click on Upload and then on Close this Window to return to the Edit window. When you have finished composing your post, click on Submit Post.

    Don't try to use the Paperclip icon, as it doesn't work on this forum.

    Hope this helps.

    Pete

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Finding values in a matrix

    Hi arupaka and welcome to the forum,

    Is the attached example what you need?

    CountIf using header match.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,926

    Re: Finding values in a matrix

    Sorry for off-topic interjection:

    Marvin - you should know better!

    Although there is no official rule regarding this behaviour, we request that wherever possible both the question AND the answer be provided in substantive detail here within the thread. An attached workbook is an excellent aid for posing a question and offering a solution, but solely doing that with no in thread explanation makes it difficult for researchers to understand or consider the Q & A of this thread without downloading what may be a pointless doc to them, if they can do that at all. Doing that also hides the content from search engines so others may never benefit from this.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    09-03-2019
    Location
    Portugal
    MS-Off Ver
    2016
    Posts
    2

    Re: Finding values in a matrix

    Thank you everyone for the prompt replies. And thank you Marvin for reading my mind! I knew this was be an easy fix, but sometimes you just wander around...

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Finding values in a matrix

    Hey AliGW,

    I'm just here to answer questions. I built the sample he didn't know how to do and did what I thought was his answer. I attached the file asking if this was what he meant. I guess I've just seen lots of problems and have an idea of needs? Psychic? If I have time and think I can answer the problem, I'm not adverse to building the data for the OP.

    Uncle Marv

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,926

    Re: [SOLVED] Matching values between array and matrix

    Marvin - you should know by now that we expect to see some form of explanation in your post. Please provide more detail of what you have done inside the attachment when you provide one. NOBODY should have to open an attachment to get a sense of the solution offered - some members won't be able to, and threads are not for the sole benefit of the OP, but for the benefit of all. Please comply with this request in future. Thanks.

+ 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. Matrix Multiplication in VBA and storing values in another matrix
    By anwid in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-06-2018, 06:23 AM
  2. Finding a specific row of a matrix in another matrix
    By hfarhadi in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-27-2014, 04:14 PM
  3. Replies: 2
    Last Post: 11-05-2014, 03:41 AM
  4. [SOLVED] Finding determinant of a 2 x 2 matrix
    By tjsdndnjs in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-16-2012, 01:58 PM
  5. Finding the last occurance of a value in a matrix
    By Ayjay in forum Excel General
    Replies: 1
    Last Post: 07-15-2011, 02:27 AM
  6. [SOLVED] finding values in a matrix automatically
    By trekvana in forum Excel General
    Replies: 5
    Last Post: 04-19-2011, 12:06 AM
  7. Finding the position of a value in a matrix
    By jamesryan in forum Excel General
    Replies: 2
    Last Post: 04-27-2009, 02:47 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