PDA

View Full Version : Solved: Same Value and SUM



gussi
08-10-2007, 02:37 AM
Hi guys,

I have a value Column(E) which i have sorted so biggest value is lowest in the sheet.

I use this to find the maximum value:

Set myrange2 = Worksheets("Sheet3").Range("E:E")
max1 = Application.WorksheetFunction.Max(myrange2)

So max1 is now my maximum value.

I have row of data from A:N so the problem is that i can maybe have 3 or 4 or... rows with the maximum value.

Now I need need something, loop i think, to find out those rows and then go to a blank cell in lowest row (O column) and SUM up column F in those rows where E is the maximum value..

:help

Regards,
Gussi

Charlize
08-10-2007, 03:01 AM
In O1 put
=SUMIF(F2:F1000,MAX(E2:E1000))Will sum everything between F2-F1000 that's has the maximum value of E2:E1000

gussi
08-10-2007, 03:09 AM
dosen?t work for me... I get an error, it is suppose to be i think SUMIF(range;criteria;[sum_range])

But if i do SUMIF(F2:F1000;MAX;E2:E1000) i only get zero

Do you have any idea about code for this?

Charlize
08-10-2007, 03:27 AM
Look at this attachment. Anything between [] is not necessary. In this case, the function thinks that he needs to count the values in F.

gussi
08-10-2007, 03:29 AM
i?m having problem with saving files, so it would be very nice if you could post this.

rory
08-10-2007, 05:36 AM
If you use semicolons as list separator, it would be:

=SUMIF(F2:F1000;MAX(E2:E1000))
though the function name may be different depending on your language version.

gussi
08-10-2007, 05:56 AM
I just don?t know why this dosen?t work, I always get 0 in the column
Do you know what?s the problem?

gussi
08-10-2007, 06:04 AM
I found it out
I Had to do SUMIF(F2:F1000;MAX(F2:F1000);E2:E1000)


thx for ya time guys,

Regards, Gussi