Inverse And Multiplication Of Matrices In VBA

Nov 30, 2008

1) I have declared:

Mtrx(20,20) as Integer, where i have a Matrix

1 2 3
1 2 3

How can I do an inverse of this matrix using only VBA commands?

2) I have :
Mtrx(20,20) as Integer, for example :

3 1
2 0

and Mtrx1(20,20) as Integer :
1 2 0
0 1 1

How to multiply these matrices using only VBA ?

View 9 Replies


ADVERTISEMENT

Solving Multiplication Of Two Matrices With Entries Decimal

Mar 16, 2014

Problem solving multiplication of two matrices with entries decimal in vba code:

Code:
Option Explicit

Public MatrixA(30, 30) As Long
Public MatrixB(30, 30) As Long
Public MatrixC(30, 30) As Long
Public RowA As Integer
Public ColA As Integer
Public RowB As Integer
Public ColB As Integer

Function ProperMaticesSizes() As Boolean

[Code] .........

View 1 Replies View Related

Dynamic Correlation Matrices

Sep 15, 2014

I have a table that I add rows to via a macro. I am trying to add correlation matrices that find the last row of the table, and include a certain number of rows above that to create a rolling correlation. For example, if I want the 2 week correlation, I would like the last 10 rows of data, but if I add another row, this formula should move down to incorporate the new row and deselect the now 11th day preceding. I do this manually but it is very time consuming.

View 9 Replies View Related

Multiply Two Matrices With MMULT Macro

Apr 4, 2008

I have two ranges: A1:F1 and A5:A10, 6 elements in each range. When I multiply one by the other I have to enter a formular in some cell (let's say, A14 - we will put the result there): "=MMULT(A1:F1, A5:A10)" and then press Ctrl-Shift-Enter. Very simple.

Question is this: suppose I do not know in advance that I will have 6 elements in each vector, it might be more than 6 or less than six. I will introduce an integer "n", which is the number of elements. Now I have to write a Sub that will perform multiplication. I wrote smth that does not work and I was wondering if someone has ever done this already and can give me a guidance what I am doing wrong. I HAVE ONE CONSTRAINT: I HAVE TO TYPE IN THE FORMULA INTO THE SPREADSHEET VIA VBA (as this will be used further in Solver, which requires formulas to be present in cells).

Y
Sub test()
Dim n
n = 2
Range("A14").Formula = "=MMULT(A1: & Chr(64+n-1)& 1, A5:A & 5+n-1)"
End Sub

I thought it would be equivalent to MMULT(A1:B1, A5:A6).

View 2 Replies View Related

Using Matrices In Formulas, Using Letters As Input In Userforms

May 27, 2006

I have a matrix with default probabilities. I have this matrix in my worksheet. The user will give the number of periods to be calculated with and it will result in a new matrix with default periods over time of choice.

Private Sub UserForm_Click()
Dim numberof_text_Change As Single
Dim initial_text_Change As Single

Range("U36:AC44").Select
Selection.FormulaArray = "=matrixpower(R[-10]C:R[-2]C[8],numberof_text.value)"
End Sub

matrixpower is a function that works perfectly well. It takes one matrix as an argument and the number of periods to use. It then simply computes the chosen number of powers of my matrix. I have a userform that has an inputbox called numberof_text which specifies the number of periods that the user wishes to use in calculating the chance of default. Hence I would like to use this variable as an argument in the formulaarray. This doesn't seem to work! I only get "#VALUE!" in every cell. If I replace "numberof_text.value" in the matrixpower function with a number it works fine. What to do?

What the function needs to do is take an argument which is the matrix I have on my spreadsheet. Take the number of times to take powers of the matrix and print it on a pre-specified place on the worksheet. If I cannot use variables with FormulaArrays, then is there another good way of choosing the matrix to use with "powermatrix"?

View 2 Replies View Related

Inverse Of Matrix Using VBA?

Jan 23, 2014

I'm trying to do the inverse matrix of a matrix captured by an inputbox, but it doesn't work

This is the code:

Code:

option explicit
option base 1
sub matrix()
Dim M() As Double
Dim B() As Double
Dim Y() As Double
Dim columnas As Range

[code]......

the error is: Error 13 the types do not match

View 7 Replies View Related

Inverse Cotangent

Apr 28, 2008

how to this in excel 2007... ie... cot^-1(X)

View 9 Replies View Related

Inverse Vlookup

May 16, 2007

Basically we have a "master" spreadsheet that people type in all day. During the day we have another team which send us a seperate " upload" spreadsheet inputs some of the cells for us, and I need to vlookup these values and ensure that all this information is input in.

Now a vlookup would be quite easy to do but I wont be able to use that as the cells would be full of Vlookups - and I would end up with a load of #N/A errors. The workbook is also shared and any macro would have to work with other users in the sheet.

View 9 Replies View Related

How To Inverse 3x4 Matrix In Excel

May 26, 2012

how to inverse a 3x4 matrix in excel.

I can easly inverse NxN Matrix ( 3x3 ,4x4,2x2)

The matrix I am trying to inverse looks like this

1 1 1 1
3,5 2,5 1,8 2
17,1 11,1 5,1 6

View 3 Replies View Related

Calculate Inverse Of A Matrix

Jan 21, 2008

I am trying to calculate the inverse of a matrix in vba here is my code, I get an error 2015 when I run my code

Function InterpolationCubique(TableauMaturites, TableauDonnees, DateCalculees, _
Optional EstFactActua As Boolean = False, _
Optional DateDeCalcul As Date)
On Error Goto zob:
Dim TabMat
'talbeau des maturites des donnes source
Dim TabData
'donnes source
Dim TabDates
'dates a calculer
Dim i As Integer, j As Integer
'variables de boucle
Dim TabRetour
'donnees renvoyees
Dim MatriceDate(4, 4)
'Matrice des coefficients des parametres
Dim MatDateInv As Variant
'Matrice inverse de MatriceDate
Dim VecTaux(4, 1)
'vecteur des donnees solutions du systeme
Dim VecParam
'vecteur des parametres calcules

' conversion des arguments en tableaux
TabMat = CTableau(TableauMaturites)
TabData = CTableau(TableauDonnees)
TabDates = CTableau(DateCalculees)
'dimensionnement du tableau de retour
Redim TabRetour(LBound(TabDates) To UBound(TabDates)).................

View 2 Replies View Related

Inverse Probability Mass Function

May 5, 2014

=NORM.DIST(-0.7525,0,1,FALSE)=0.30057

I want to do inverse 0.30057 To get -0.7525 ,NORM.INV(0.30057,0,1) This function returns only cumulative distribution .

View 3 Replies View Related

Inverse Distance Weighting Function?

Apr 15, 2014

I have longitude/longitude points in which I would like to apply inverse distance weighting statistics to.

I would like to possibly create a chart with the results...

See link below for explanation of inverse distance weighting.

[URL] ....

is there a function in excel or access that I would be able to use to achieve this goal?

View 3 Replies View Related

Excel 2007 :: Inverse Cotangent

Apr 28, 2008

How to do this in excel 2007...

ie... cot^-1(X)

View 9 Replies View Related

Fill Table From 4 Known Values. Inverse Of Extrapolating

Sep 24, 2008

From four known set values at the four corners of a table, how can I fill in the values in between? I.E. the inverse of extrapolating. I have a program within a programme that will do this, so i know its possible, but ideally i would like to be able to do it straight into a spreadsheet.

View 3 Replies View Related

Getting Sum Of The Multiplication Of Two Columns

Jul 10, 2014

I want to get the sum of the multiplication of two columns. Why the macro is needed?

Because I want always to multiply the first column with a series of column combinations. At the end I want to get a number for each case.

Example.

I have 4 columns (this can vary). I want to perform:

A*B, A*C, A*C, A*(B+C)

View 4 Replies View Related

VBA Multiplication Of Two Columns?

Oct 6, 2012

what i am trying to do is multiply the numbers in two seperate cells on the same row (e.g. C1*D1) and do this for the whole column where there is data (so it could go down to (C9*D9)

I was wondering how I would execute this in a macro, I am also looking to show the total value of all these added together but one step at a time

View 8 Replies View Related

Multiplication Formula

Feb 19, 2009

As I have illustrated in the example below, I want to multiply a value by 1.(something). The 1. is always constant, where the I8 cell is variable. I can't get this to work.

=H15*1.(I8)

View 9 Replies View Related

Values Multiplication

Jul 8, 2006

I have a worksheet with many lines of inputted numbers (values). I want to divide each number in the sheet by 4. However, I don't want to move any of the numbers because other sheet in the workbook refer to these cells. Does anyone know how i can do this easily?

View 3 Replies View Related

Multiplication/addition Function

Jan 27, 2009

I obviously know less about functions than I thought I did. I've got the attached spreadsheet set up except getting totals at the bottom. The production total L44, would be column A multiplied by the quantity entered in columns L and summed. Same for Total SF, square footage in column B times quantity in L and summed at the bottom. This would continue daily, needing sums under each column.

View 4 Replies View Related

Creating Multiplication Table?

Aug 1, 2014

Using array

Part 1:

1. Create a Multipication Table up to 10x10.

2. Store the values in a multidimensional array.

3. The program should ask the user what two numbers from 1-10 would he like to multiply.

4. The program should not multiply the two numbers but instead use the two numbers as reference for the element number and locate the corresponding element.

5. The corresponding element should have the value same as the product of the two numbers entered by the user.

Part 2:

1. Do the same as Part 1 but this time automate the creation of the multiplication table using the concept of array.

Here's what I've done so far for part 1

[Code]...

But when I enter the two numbers It just displays the value in cells(2,6)

Attached File : table.xls‎ ..

View 1 Replies View Related

Attributing Values And Multiplication

Apr 25, 2007

I am writing a spreadsheet as a report for a customer and i want to show the following in the sheet.

A customer buys 12 of XProduct (retails £2)
A customer buys 15 of YProduct (retails £3)
A customer buys 20 of ZProduct (retails £5)

I want the sheet to have columns stating - Amount Bought - Product - Gross Amount.

And i want to be able to have the product column intelligent enough to know that if i type any of my products sold it will automatically attribute the correct cost (i.e. I type in Xproduct and it knows that value is £2) so that in the Gross Amount column it will all make sense, and save me having to manually put in the retail cost each time which will occasionally change. At present i have the same three columns and i multiply the Amount Bought with what i know is the cost and do the sum myself and then enter the result in excel -

View 9 Replies View Related

Multi-Criteria Multiplication (multiply (x * Y * Z *)

Aug 4, 2009

I have three reference cells (a1, a2, a3).

Below, starting from b4 to l4 I have years from 2005 to 2015, row 5 for the same range contains data, row 6 (c to l) contains a growth rate.

I need to come up with a formula that can multiply (x * y * z *... [product-like formula]) the growth rates for all the years where the current year (row 4) is bigger than reference the reference year in a1 or smaller than reference year in a2. A3 is then used to multiply that total.

View 6 Replies View Related

Multiplication To Ignore Minus Numbers

Oct 7, 2009

If I wanted to get a cell, say A1, to multiply a value, for example 7, by the results in another cell, say B1, but NOT multiply if that cell's value is a minus number, is there a way of getting Excel to do that?

Normally I'd just type =SUM(A1*B1)*7, but how can that be reconfigured to ignore minus numbers? e.g. if B1 contained -5, ?

View 10 Replies View Related

Creating Random Multiplication Table

Aug 9, 2013

Here's what I'd like to do:

Have 10 columns... one column would be for the "1s", another for the "2s", another for the "3s", etc...

But I don't want to have them in straight order (i.e. 1 x 1 =, 1 x 2 =, 1 x 3 =, etc...) because the pattern is easily memorized, no matter what number he's working on.

I'd like to be able to hit a button (or something) and have each column shuffle (or randomize) the order in which the equations will be displayed.

So, a column might come up 3 x 6 =, 3 x 9 =, 3 x 1 =, 3 x 4 =, etc...

And next time it might come up 3 x 5 =, 3 x 2 =, 3 x 4 =, etc...

This way he won't be able to memorize any patterns and he'll actually need to learn his multiplication tables.

View 14 Replies View Related

VBA Noob Multiplication Isn't Working With Decimal

Apr 2, 2009

I just started using VBA and WOW at the possibilities!! I have some data I am trying to calculate and decided upon researching VBA that this would be the easiest way to do what I need to. The code goes through no errors but D2 is .0001 and N2 is 12000 and the answer I get when I multiply the 2 through VBA is 0.000 however if I change the number in D2 to 2 then I get 24000. I tried the help menu and possibly this is because I didn't do something right with the decimal?

View 3 Replies View Related

Can't Multiply...why Is Simple Multiplication Incorrect?

Nov 7, 2008

On the PROPOSAL tab, at I41, a simple multiplication instruction is wrong. It's multiplying 72*186.53 which = 13430.16 in the real world, but on this sheet 11 cents are missing. I'm pulling my hair out on this one....

View 4 Replies View Related

Range Multiplication - Values Multiplied By 1.07?

Sep 25, 2011

In a range ("A1:A30") are values, What I need to do is have those values multipled by 1.07 and the new value incerter in the cell using VBA, I dont wantto use a formula.

View 5 Replies View Related

Basic Addition, Subtraction & Multiplication

Apr 12, 2008

Take a single cell in column D, and multiply it by a single cell in column E, which will equal F. Take column F, and multiply it by .02 (2%), which will equal G. Take a cell in column G, and subtract it from F, which will equal I. And this all takes place in the same row. Then have it move down to the next row, and do the same thing..... so it would basically look like this.....

A B C D E F G H I
1 D1 E1 (D1*E1) (F1*.02) (G1-F1)

2 D2 E2 (D2*E2) (F2*.02) (G2-F2)

3 D3 E3 (D3*E3) (F3*.02) (G3-F3)

For easier reading.... in each row I want it to do the following math
D*E=F
F*.02=G
G-F=I

And then do it for every row that I have data in (excluding the VERY first row). I am -COMPLETELY- sorry if I broke any rules, and am also sorry for the poor representation

View 5 Replies View Related

Excel 2003 :: Labeling Horizontal Axis Of XYScatter Chart With Math Division Inverse

Jan 16, 2013

We make many graphs using XYscatter charts with lots of data points using Excel 2003 with the horizontal scale properly scaled as frequency. I have been asked to label that axis in some way as period (=1/frequency) without changing the scaling for the data plot. Is there a suitable way to do this? It would be OK to just change the axis numbers to 1/frequency computed from them automatically. Is Excel 2010 any easier for this?

View 9 Replies View Related

Excel VBA Array Scalar Multiplication And Addition

Oct 20, 2012

I have two columns of data in an excel sheet that are equal in size and both only contain numbers.

I'm trying to write a macros which will put both of these sets into arrays, then perform a calculation on them.

Specifically ArrayA + 3*ArrayB then put the result back into the worksheet in a new column. Below is the code I have so far.

Dim ArrayA As Variant
Dim ArrayB As Variant
Dim ArrayC As Variant

ArrayA = Worksheets("Sheet1").Range("A1:A5")
ArrayB = Worksheets("Sheet1").Range("B1:B5")

This is where things go bad
ArrayC = ArrayA + 3 * ArrayB

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved