Looking up when there is more than 1 result and returning results from different part of spreadsheet!

LauraPlumb

New Member
Joined
Jan 14, 2011
Messages
11
Hi all,

Apologies for the long title it is a difficult one to explain but here goes:

I have a max value. What i want it to do is find the occurances for the max value along the same row, look up to see which week (number1-47) they occured in (row above), look at a different part of the spreadsheet and add up the values that appear on the same line under the found week numbers.

In terms of occurances the max value ranges from 1 - 20 times on different rows.

An example of the range of cells would be:

Max value in E6
Area to lookup max in: DG6:EZ6
Week Headings: DG3:EZ3

Area to lookup the week heading found above:
06:BI6

Any results it finds i need it to add them up and put them into cell J6

Bearing in mind the spreadsheet has 5616 rows i would like something that will just copy down.

Hope this makes sense - any help would be greatly appreciated =)
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
this expression is not clear
?
'"i need it to add them up and put them into cell J6"
sumuip what?????
suppose there are 6 weeks the max is found then the sum up is 6xmax,.value if max value is 25 J6 shoudl have 150
is it so???

try this macro

Code:
Sub test()
Dim x As Double, j As Integer, r As Range
x = Range("E6")
Set r = Range("DG6:EZ6")
j = WorksheetFunction.CountIf(r, x)
If j = 0 Then MsgBox "this max is not available"
Range("J6") = j * x
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,134
Members
452,890
Latest member
Nikhil Ramesh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top