PDA

View Full Version : Solved: Need help with a macro!



Martin B.
01-11-2011, 09:00 AM
Good people of the 'vbax forum! :bow:

I am in need of your help since my VBA skills are somewhat lacking.

What I need is a macro that sums up data from another sheet. There are some criteria’s though.

The values I need to sum up is in column "J". But I need it to be sorted so it only sums up the values from column "J" from the rows that has a certain other text/number value in column "B", "I" and "G". Regarding the column G the criteria for the value is not an exact match of a value but that the value have the same matching first three digits.

I will use the code to sum up four values with different criteria.

Hope someone can help me.

Many Thanks!
Martin

Bob Phillips
01-11-2011, 09:04 AM
Just use SUMPRODUCT

=SUMPRODUCT(--(Sheet2!B2:B20="abc"),--(Sheet2!I2:I20=17),--(Sheet2!G2:G20="X"),Sheet2!J2:J20)

Martin B.
01-11-2011, 09:05 AM
Thanks man! Will try to get it to work!