+ Reply to Thread
Results 1 to 19 of 19

I have a problem with solving a matrix

  1. #1
    Registered User
    Join Date
    04-24-2024
    Location
    Bulgaria
    MS-Off Ver
    Office 365
    Posts
    18

    I have a problem with solving a matrix

    Hi! i have a problem with solving a 19x19 matrix.

    I've got an error !NUM when start MINVERSE a matrix.

    Is it a problem if some rows are 0 all of them?

    P.S. I've checked it right now after I've read some posts on here with MDETERM and it returns 0.

    P.P.S. And any idea how to solve system of linear equotations in excel only by formulaes and functions and not in VBA?
    Last edited by angel44e; 05-31-2024 at 08:59 AM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,468

    Re: I have a problem with solving a matrix

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Registered User
    Join Date
    04-24-2024
    Location
    Bulgaria
    MS-Off Ver
    Office 365
    Posts
    18

    Re: I have a problem with solving a matrix

    The matrix is (A1:S19)

    I wish to solve these system of equatations:

    -x1+x3+x5+x6+x8+x9+x10=20
    x1-2x3+x5+x6+x8+x9+x10=20
    x1+x3-4x5+x6+x8+x9+x10=20
    x1+x3+x5-4x6+x8+x9+x10=20
    x1+x3+x5+x6-4x8+x9+x10=20
    x1+x3+x5+x6+x8-4x9+x10=20
    x1+x3+x5+x6+x8+x9-4x10=20
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,950

    Re: I have a problem with solving a matrix

    I'm not sure I understand exactly what you are doing. In the OP, you say that you are trying to invert a 19x19 matrix (implying a system of 19 equations with 19 unknowns). However, in post #3, you describe a problem involving 7 equations with 7 unknowns. I observe that Excel has no trouble inverting the matrix if I set up the 7x7 matrix given in post #3.

    If I'm guessing correctly, yes, I think the problem comes from having full columns/full rows of 0s (indicating that those variables/equations are not actually part of the problem and, therefore, not part of the solution). I don't know how you like to interact with your spreadsheet, but I think you will need some strategy for extracting the variables and equations that are part of each problem and build your input matrix from that. Not knowing how you like to interact with your spreadsheet, I have no suggestion to offer at this point, but it looks like the main question is how to reduce the given 19x19 matrix (that represents the largest possible problem?) down to the nxn matrix that represents a specific problem.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    UK
    MS-Off Ver
    365
    Posts
    640

    Re: I have a problem with solving a matrix

    My math is VERY rusty, but have a look at the attached, please.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    04-24-2024
    Location
    Bulgaria
    MS-Off Ver
    Office 365
    Posts
    18

    Re: I have a problem with solving a matrix

    Quote Originally Posted by MrShorty View Post
    I'm not sure I understand exactly what you are doing. In the OP, you say that you are trying to invert a 19x19 matrix (implying a system of 19 equations with 19 unknowns). However, in post #3, you describe a problem involving 7 equations with 7 unknowns. I observe that Excel has no trouble inverting the matrix if I set up the 7x7 matrix given in post #3.

    If I'm guessing correctly, yes, I think the problem comes from having full columns/full rows of 0s (indicating that those variables/equations are not actually part of the problem and, therefore, not part of the solution). I don't know how you like to interact with your spreadsheet, but I think you will need some strategy for extracting the variables and equations that are part of each problem and build your input matrix from that. Not knowing how you like to interact with your spreadsheet, I have no suggestion to offer at this point, but it looks like the main question is how to reduce the given 19x19 matrix (that represents the largest possible problem?) down to the nxn matrix that represents a specific problem.

    Quote Originally Posted by RaulSerg View Post
    My math is VERY rusty, but have a look at the attached, please.

    You are really GODDSS!!!.That's all I needed RaulSerg.That's all done by excel math formulae and no need VBA and Solver add-in.

    THANK YOU VERY MUCH!!!

    And I've not seen any other forum for any topic someone answer so fast.THANK YOU ONCE AGAIN!!!
    Last edited by angel44e; 05-31-2024 at 12:21 PM.

  7. #7
    Registered User
    Join Date
    04-24-2024
    Location
    Bulgaria
    MS-Off Ver
    Office 365
    Posts
    18

    Re: I have a problem with solving a matrix

    But one question more,RaulSerg! What if values in 1st 19x19 matrix are dynamic from other sheet and could be variable - so matrix could be only 1 to 19x19,how could I manage that solution?

  8. #8
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    UK
    MS-Off Ver
    365
    Posts
    640

    Re: I have a problem with solving a matrix

    Please give an example in an Excel sheet.
    I am not really clear what the problem is.
    I see currently no reason why Excel would not be able to invert a 19x19 matrix, unless the determin is 0 which I guess means the matrix cannot be inverted.

    MrShorty's answer is pointing into the same direction.

    Attached is an example of any 19x19 matrix that I think is sort of automatic.

    edit: attachment fixed
    Attached Files Attached Files
    Last edited by RaulSerg; 05-31-2024 at 03:22 PM.

  9. #9
    Registered User
    Join Date
    04-24-2024
    Location
    Bulgaria
    MS-Off Ver
    Office 365
    Posts
    18

    Re: I have a problem with solving a matrix

    Quote Originally Posted by RaulSerg View Post
    Please give an example in an Excel sheet.
    I am not really clear what the problem is.
    I see currently no reason why Excel would not be able to invert a 19x19 matrix, unless the determin is 0 which I guess means the matrix cannot be inverted.

    MrShorty's answer is pointing into the same direction.

    Attached is an example of any 19x19 matrix that I think is sort of automatic.

    edit: attachment fixed

    That's all I need,but when I run =MINVERSE(DROP(A71#;;-1)) I've got !VALUE error and I couldn't manage it.I've checked formatting values,but somehow !VALUE error is still on sheet.

    I've seen that =LET(x;A1:V19;y;FILTER(x;BYROW(x;LAMBDA(a;SUM(a)>0)));FILTER(y;BYCOL(y;LAMBDA(b;SUM(b)>0)))) give me only 16 columns and 14 rows when I input all 19 values.
    Last edited by angel44e; 05-31-2024 at 04:39 PM.

  10. #10
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    UK
    MS-Off Ver
    365
    Posts
    640

    Re: I have a problem with solving a matrix

    Provide a file that shows your error.
    At least based on my file this formula
    Please Login or Register  to view this content.
    doesn't make sense to me.

  11. #11
    Registered User
    Join Date
    04-24-2024
    Location
    Bulgaria
    MS-Off Ver
    Office 365
    Posts
    18

    Re: I have a problem with solving a matrix

    That's file 19x19

  12. #12
    Registered User
    Join Date
    04-24-2024
    Location
    Bulgaria
    MS-Off Ver
    Office 365
    Posts
    18

    Re: I have a problem with solving a matrix

    That's file 19x19!
    Attached Files Attached Files

  13. #13
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    UK
    MS-Off Ver
    365
    Posts
    640

    Re: I have a problem with solving a matrix

    First, you need to include also include column T in row 71.
    Secondly, the generic formula I provided filters out columns that should not be filtered out because your actual data is much different than your previous data provided.
    For example, X16 gets filtered out because the column sums to zero, so the formual is doing something here that it shouldn't be doing.

    As I don't know how your actual data might morph, it's hard to come up with a correct filtering for all situations.

    Best if you figure out or explain in which situations rows and columns need to be included and when not.

    In your dataset
    Please Login or Register  to view this content.
    gives a correct result.

    So you just need to select the correct data for the function.

  14. #14
    Registered User
    Join Date
    04-24-2024
    Location
    Bulgaria
    MS-Off Ver
    Office 365
    Posts
    18

    Re: I have a problem with solving a matrix

    Hi again.RaulSerg! The matrix values comes from F4:F22 cells(substracted by 1) and from P3 cell (value for T50:T68) - could be from 1 to 1000 natural numbers.

    Then that leads to equations system that could be solved by matrix 19x19 (max) or 1x1(min) - it depends from how many values are input in F4:F22.

    I have noticed that if I input value <19 in F4:F22 cells then matrix is full and if it's >=19 then matrix is cut.But if I run MMULT function

    only one value is returned and not all of 19 values.What could be wrong?

    P.S. I'm sorry for my poor English but I could try to explain what's you need to correct matrix formulaes!

    P.P.S.By the way I've corrected some errors in sending matrix values and that's no problem >=19.I've corrected values T50:T68,it should be negative.I've formated F4:F22 cells and P3 cell to custom too.But I receive !CALC error right now.

    P.P.S.I've solved these all problems,RaulSerg and only one stayed.How to point values A117:A135 to be filled in H4:H22 in that order if F4:F22 are filled.
    Attached Files Attached Files
    Last edited by angel44e; 06-01-2024 at 03:33 AM.

  15. #15
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    UK
    MS-Off Ver
    365
    Posts
    640

    Re: I have a problem with solving a matrix

    An alternative approach to construct the matrix could be this:
    Please Login or Register  to view this content.
    or whatever your relevant input range is.
    That should filter out only if all values are zero, but not if the sum is accidentally zero.

    How to point values A117:A135 to be filled in H4:H22 in that order if F4:F22 are filled.
    I don't understand what that means.
    What exactly is the required output under what scenario and what is the logic employed?

  16. #16
    Registered User
    Join Date
    04-24-2024
    Location
    Bulgaria
    MS-Off Ver
    Office 365
    Posts
    18

    Re: I have a problem with solving a matrix

    Thank you very much for your help RaulSerg!!! I've managed with last my question
    Last edited by AliGW; 06-01-2024 at 07:50 AM. Reason: Please don't quote unnecessarily - use the Quick Reply button instead.

  17. #17
    Registered User
    Join Date
    04-24-2024
    Location
    Bulgaria
    MS-Off Ver
    Office 365
    Posts
    18

    I have a problem with solving a matrix

    Hi all,again! And especially to RaulSerg who helped me at https://www.excelforum.com/excel-for...-a-matrix.html

    Everything is OK,but when I wish to change dynamically 1st range ( I define it with Name manager and I save the workbook).But when I reopen that 1st range is dynamically changed by output source and that formula

    =LET(x,NewRange,FILTER(FILTER(x,BYROW(x,LAMBDA(a,COUNTIF(a,)<>COLUMNS(x)))),BYCOL(x,LAMBDA(a,COUNTIF(a,)<>ROWS(x)))))

    is saved ex-data(and gives a VALUE! error) when 1st saving workbook and not changing anything as 1st range is changing dynamically at the same time.

    How could I solve that?

  18. #18
    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. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,551

    Re: I have a problem with solving a matrix

    Provide a workbook that illustrates the issue, please - instructions at the top of the page.
    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.

  19. #19
    Registered User
    Join Date
    04-24-2024
    Location
    Bulgaria
    MS-Off Ver
    Office 365
    Posts
    18

    Re: I have a problem with solving a matrix

    That's a workbook! Values from F4 to F22 cells are values for that 1st range (A50:T68).These values(F4:F22) are from 2nd sheet of that workbook which are updated in every 2-3 secs from output source.

    Formula

    =LET(x;A50:T68;FILTER(FILTER(x;BYROW(x;LAMBDA(a;COUNTIF(a; )<>COLUMNS(x))));BYCOL(x;LAMBDA(a;COUNTIF(a; )<>ROWS(x)))))

    in A71 cell create new 2nd range from that 1st range (A50:T68) which have no blank rows and columns.

    And if I link that sheet to output source for data update it's working till I've not closed the sheet and save it.Then after reopen it that formula in A71 cell shows VALUE! error.
    Attached Files Attached Files

+ 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. Solving Matrix Multiplication without MMULT
    By KinGG_Steff in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-03-2019, 10:26 AM
  2. Problem with solving a feasibility check matrix
    By adamadam0000 in forum Excel General
    Replies: 3
    Last Post: 03-05-2017, 12:46 PM
  3. I Need Help Solving This Problem
    By zZPingZz in forum Excel General
    Replies: 3
    Last Post: 07-09-2016, 09:04 AM
  4. Problem solving in VBA
    By Lv27 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-14-2012, 10:17 AM
  5. Solving m*n matrix
    By kakoc in forum Excel General
    Replies: 4
    Last Post: 06-15-2010, 09:30 AM
  6. Solving Problem
    By jocpinmn in forum Excel General
    Replies: 2
    Last Post: 05-26-2007, 10:13 AM
  7. Need help solving this problem
    By Stan T in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-25-2006, 03:09 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