+ Reply to Thread
Results 1 to 24 of 24

Formula needed for a matrix

  1. #1
    Registered User
    Join Date
    06-28-2017
    Location
    East Kilbride, Scotland
    MS-Off Ver
    2010
    Posts
    12

    Formula needed for a matrix

    Hi everyone, this is my first post and I hope someone can help me.

    I need to automate the task of filling out a matrix which counts for each country how many calls they have been on with every other country for just 2 funding frameworks. Using filters I have manually counted for Austria the number of calls they have had with Belgium and Bulgaria to demonstrate. However, to do this manually for all 28 countries will take too long so I need a formula that will use the variables in the following columns:

    Column U: “ERA-NET Cofund” & “ERA-NET Cofund (unfunded call)”
    Column Z: 1 (some countries have more than one funding organisation in a call so they have been numbered 1, 2, 3 etc)
    Column Y: 2 countries eg Austria & Belgium
    Column M: Only count Joint Calls for both countries

    I have tried using COUNTIFS but it returns 0 when there is more than 1 criteria to be counted in the same column (U and Y). The other problem I have is with column M, I only want to count the Joint Calls for both countries but I don’t know how to count duplicates only or to ignore unique.

    I have attached a sample of my Masterfile to show what the data looks like.

    Thanks
    Attached Files Attached Files

  2. #2
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,730

    Re: Formula needed for a matrix

    Not sure I completely understand this:

    Column Y: 2 countries eg Austria & Belgium
    Column M: Only count Joint Calls for both countries
    Can you tell us which 25 records count towards your first manually entered result?
    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.

  3. #3
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,730

    Re: Formula needed for a matrix

    I can give you an answer if you will just please clarify this:

    Column M: Only count Joint Calls for both countries

    The other problem I have is with column M, I only want to count the Joint Calls for both countries but I don’t know how to count duplicates only or to ignore unique.
    Give me some examples of what you mean by this.

  4. #4
    Registered User
    Join Date
    06-28-2017
    Location
    East Kilbride, Scotland
    MS-Off Ver
    2010
    Posts
    12

    Re: Formula needed for a matrix

    Hi AliGW

    I basically filtered the data on the columns listed (U, Z, Y) selecting the specific criteria.

    Then for column M I deselected the Joint Calls which had only 1 of the 2 countries listed.

    The result of the filtering was 50 records, however, since there is 1 record for each country on each call I divided 50 by 2 giving me 25 calls that both Austria and Belgium took part in.

    Hope that explains how the manual process works and hopefully shows why I need to automate. I have the file saved with the filters still applied if you would like me to upload it.

  5. #5
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,730

    Re: Formula needed for a matrix

    Yes - thanks. I'll have another look. Based on U, Y and Z alone I make it 56, so I need to eliminate the 6 where only one country is listed.

  6. #6
    Registered User
    Join Date
    06-28-2017
    Location
    East Kilbride, Scotland
    MS-Off Ver
    2010
    Posts
    12

    Re: Formula needed for a matrix

    Exactly, I need to ignore the calls where only 1 country is listed, then divide by 2.

  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. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,730

    Re: Formula needed for a matrix

    I was hoping to be able to solve this, but I have fallen at the final hurdle.

  8. #8
    Registered User
    Join Date
    06-28-2017
    Location
    East Kilbride, Scotland
    MS-Off Ver
    2010
    Posts
    12

    Re: Formula needed for a matrix

    Thanks for trying

    Just hope there is someone who can help.

  9. #9
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,706

    Re: Formula needed for a matrix

    This isn't automatic, however I hope that it may help.
    I added two helper columns to the 'data entry' sheet.
    The formula that populates column BB is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    The formula that populates column BC is: =IF(BB694=2,1,0)
    Note that I have hidden columns N:X so that I could do a count to verify my results.
    On the 'Matrix' sheet cells AF2 and AG2 have data validation applied so that they drop down the names of the cities in column A.
    AH2:AJ2 contain the other criteria as per listed in post #1
    AL2* counts using the formula: =AGGREGATE(9,5,'Data Entry '!BC2:BC1735)/2
    Unfortunately there is still a need to filter the 'data entry' sheet. Perhaps someone on the VBA side can provide a way to link the filtering process with the values in AF2:AJ2 from the 'Matrix' sheet. (However, I don't know enough about VBA to be sure that is possible)
    EDIT: I'm now thinking that the filtering could be done by Advanced Filter, I'll try and work on that tomorrow (if one of the other contributors hasn't done so by then)
    *AL2 is reporting a count of 24, instead of 25, for Austria & Belgium. I believe that the reason is that cells M485 and M497 are slightly different (one has a space between for and Europe and the other doesn't).
    Let us know if you have any questions.
    Attached Files Attached Files
    Last edited by JeteMc; 08-02-2017 at 10:25 PM. Reason: added Edit
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  10. #10
    Registered User
    Join Date
    06-28-2017
    Location
    East Kilbride, Scotland
    MS-Off Ver
    2010
    Posts
    12

    Re: Formula needed for a matrix

    Hi JeteMc

    I've tried it out a few times and it seems to deliver the results. The only trouble is the time consuming filtering as I would have to filter over 700 times to complete the matrix. So some more automation perhaps through the advanced filter will help greatly. If no-one else comes up with a solution I will definitely use this one.

    I'm new to the forum so don't know - would I need to post on the VBA thread or will the guys see it in this thread?

    Many thanks

  11. #11
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,730

    Re: Formula needed for a matrix

    No - we don't allow thread duplication, but we could move the thread to the VBA section and/or add VBA to the thread title.

  12. #12
    Registered User
    Join Date
    06-28-2017
    Location
    East Kilbride, Scotland
    MS-Off Ver
    2010
    Posts
    12

    Re: Formula needed for a matrix

    Thanks AliGW, I'll wait a wee while to see if anyone else comes up with a solution first.

  13. #13
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,730

    Re: Formula needed for a matrix

    That's fine - your call!

  14. #14
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,706

    Re: Formula needed for a matrix

    Go ahead and move the thread if you would like. I'll still work on the Advanced filter and hopefully someone there will give you a better solution in the meantime.

  15. #15
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Formula needed for a matrix

    Hello,

    Try this array formula in B3 & copy down & across.

    Please Login or Register  to view this content.
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  16. #16
    Registered User
    Join Date
    06-28-2017
    Location
    East Kilbride, Scotland
    MS-Off Ver
    2010
    Posts
    12

    Re: Formula needed for a matrix

    Hi Haseeb A, I copied your array formula into B3 and immediately got a #VALUE! error

  17. #17
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,730

    Re: Formula needed for a matrix

    It's an array formula confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    And it looks like it works - kudos, Haseeb!

  18. #18
    Registered User
    Join Date
    06-28-2017
    Location
    East Kilbride, Scotland
    MS-Off Ver
    2010
    Posts
    12

    Re: Formula needed for a matrix

    Doh! Shoulda remembered that...lol

  19. #19
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,730

    Re: Formula needed for a matrix

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  20. #20
    Registered User
    Join Date
    06-28-2017
    Location
    East Kilbride, Scotland
    MS-Off Ver
    2010
    Posts
    12

    Re: Formula needed for a matrix

    Hi Haseeb

    I copied it into all the cells in the matrix, unfortunately from column G (Czech Republic) on it just returns zeros.

    I tried copy/paste down each column and then across each row but it still stops working at column G.

    Any ideas? This is a brilliant solution if it would only work beyond column G.

    Cheers

  21. #21
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,706

    Re: Formula needed for a matrix

    The column Headers from column G and to the right are in row 2 instead of row 1 like the headers for columns B:F.
    It is hard to tell because they have all be merged and centered, yet another reason to avoid merge & center.
    Move those column headers up to row one, then you may then have to re-initialize the array entered formula in columns G:AC by dragging the fill handle of the cells in column F across.
    Let us know if you have any questions.

  22. #22
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Formula needed for a matrix

    Quote Originally Posted by KatOpti View Post
    ....stops working at column G...
    OK. This formula will look for header when copy across & down. Red highlighted is the change.

    Please Login or Register  to view this content.

  23. #23
    Registered User
    Join Date
    06-28-2017
    Location
    East Kilbride, Scotland
    MS-Off Ver
    2010
    Posts
    12

    Re: Formula needed for a matrix

    Brilliant! It's working perfectly now.

    Thank you so much AliGW, JeteMc and Haseeb A, you guys are the best.

    Kat

  24. #24
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,706

    Re: Formula needed for a matrix

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ 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. Please Help - Freight Matrix Needed
    By gillymore in forum Excel General
    Replies: 1
    Last Post: 12-11-2016, 11:29 PM
  2. Template needed for pricing matrix
    By mmkrc3071 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 10-11-2016, 05:44 PM
  3. Formula needed to populat matrix
    By brefed15 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-02-2016, 03:55 PM
  4. Replies: 2
    Last Post: 11-05-2014, 03:41 AM
  5. Eigenvector of matrix for nxn matrix of variable size
    By rocketscientist165 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-14-2014, 10:51 AM
  6. Replies: 2
    Last Post: 02-11-2014, 05:05 AM
  7. [SOLVED] Help needed with competion matrix and nested IF statement
    By skyping in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-16-2012, 08:09 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