Look for the highest number

Rye

New Member
Joined
Apr 24, 2023
Messages
36
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
Hi Guys, is there a way to get the highest number automatically? please see the table below. Thank you for always helping us.

MetersScoreHigh score
0021
220
31
82
95
1010
112
203
Is there a way to get the highest value automatically in this equation?
* My goal is to look for the highest score within 1 meter
* in this example, the highest score is 21
* Please note that, only the highest score will be recorded.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Was playing with this and got to the answer but with helper columns etc..

I have run out of time for now but thought i would share where i got to in case it helps others create a more dynamic all in one solution:
Book1
ABCDEFGH
1MetersScore0
200120221
3220212
431223
582353
6953103
71010323
81123
92034
Sheet1
Cell Formulas
RangeFormula
E2:F7E2=LET(r,TAKE(FILTER(A2:C9,COUNTIF(C2:C9,C2:C9)>1),,-2),r)
H2H2=LET(r,E2#,MAX(SUMIF(INDEX(r,,2),INDEX(r,,2),INDEX(r,,1))))
C2:C9C2=IF(A2-1=A1,C1,C1+1)
Dynamic array formulas.
 
Upvote 0
Was playing with this and got to the answer but with helper columns etc..

I have run out of time for now but thought i would share where i got to in case it helps others create a more dynamic all in one solution:
Book1
ABCDEFGH
1MetersScore0
200120221
3220212
431223
582353
6953103
71010323
81123
92034
Sheet1
Cell Formulas
RangeFormula
E2:F7E2=LET(r,TAKE(FILTER(A2:C9,COUNTIF(C2:C9,C2:C9)>1),,-2),r)
H2H2=LET(r,E2#,MAX(SUMIF(INDEX(r,,2),INDEX(r,,2),INDEX(r,,1))))
C2:C9C2=IF(A2-1=A1,C1,C1+1)
Dynamic array formulas.
Hi @Georgiboy, this is actually a great start. Actually I will try to use this formula now. I will surely let you know the outcome. Thank you. Enjoy your weekend.
 
Upvote 0
Hi @Georgiboy, this is actually a great start. Actually I will try to use this formula now. I will surely let you know the outcome. Thank you. Enjoy your weekend.
Good day @Georgiboy, I tried the code, but unfortunately got a different result as I can't use multiple helpers in my case. Also, A1 may be not possible for me to use because these data are in the middle of my table and A1 has info in it. I really appreciate your help, I will try to play around more with the formula you have given. Cheers
 
Upvote 0
See if this does what you want.

23 05 20.xlsm
ABC
1MetersScoreHigh Score
20021
3220
431
582
695
71010
8112
9203
High Score
Cell Formulas
RangeFormula
C2C2=LET(r,A2:A9,s,SEQUENCE(MAX(r)-MIN(r)+1,,MIN(r)),MAX(SUMIFS(B2:B9,r,">="&s-1,r,"<="&s+1)))
 
Upvote 0
Re-reading the question I am now unsure about the "within 1 meter" requirement. Here is another set of sample data.
My original formula is in C2 and gets the total of 34 because all 3 green cells are within 1 meter of 10.
However, perhaps you would count that as "within 2 meters"? If so, then the formula in C3 may be what you want?

23 05 20.xlsm
ABC
1MetersScoreHigh Score
20034
322027
431
582
697
71010
81117
9203
High Score (2)
Cell Formulas
RangeFormula
C2C2=LET(r,A2:A9,s,SEQUENCE(MAX(r)-MIN(r)+1,,MIN(r)),MAX(SUMIFS(B2:B9,r,">="&s-1,r,"<="&s+1)))
C3C3=LET(r,A2:A9,s,SEQUENCE(MAX(r)-MIN(r)+1,,MIN(r)),MAX(SUMIFS(B2:B9,r,">="&s-1,r,"<="&s)))
 
Upvote 0
See if this does what you want.

23 05 20.xlsm
ABC
1MetersScoreHigh Score
20021
3220
431
582
695
71010
8112
9203
High Score
Cell Formulas
RangeFormula
C2C2=LET(r,A2:A9,s,SEQUENCE(MAX(r)-MIN(r)+1,,MIN(r)),MAX(SUMIFS(B2:B9,r,">="&s-1,r,"<="&s+1)))
@Peter_SSs this code is an excellent fit in my situation table. Thank you very much for your help. Enjoy the rest of your weekend!!!
 
Upvote 0
Table 1.1
MetersScoreHigh Score
0021
220
31
82
95
1010
112
203
Table 1.2
MetersScoreHigh Score
0021
220
41C14 should be displaying 20 in this table.
82
105
1210
142
203
** Sorry, I did not explain it clearly.
** To make it easier, If in A2:A9 doesn’t have equal to 1m distance (Table 1.2) , get the highest single score in B2:B9.
 
Upvote 0
Book1
ABCD
1Table 1.1
2MetersScoreHigh Score
30021
4220
531
682
795
81010
9112
10203
11
12Table 1.2
13MetersScoreHigh Score
140021
15220
1641C14 should be displaying 20 in this table.
1782
18105
191210
20142
21203
22
23** Sorry, I did not explain it clearly.
24** To make it easier, If in A2:A9 doesn’t have equal to 1m distance (Table 1.2) , get the highest single score in B2:B9.
Sheet1
Cell Formulas
RangeFormula
C3,C14C3=LET(r,A3:A10,s,SEQUENCE(MAX(r)-MIN(r)+1,,MIN(r)),MAX(SUMIFS(B3:B10,r,">="&s-1,r,"<="&s+1)))
 
Upvote 0
Thanks for now using XL2BB. For the future, when you do that, don't put your instructions in the worksheet, just write them separately in your post (like I have with this message)

Looks like I was over-complicating it in the first place. :eek: What about this instead?

23 05 21.xlsm
ABC
1Table 1.1
2MetersScoreHigh Score
30021
4220
531
682
795
81010
9112
10203
11
12Table 1.2
13MetersScoreHigh Score
140020
15220
1641
1782
18105
191210
20142
21203
Sheet2 (3)
Cell Formulas
RangeFormula
C3,C14C3=LET(r,A3:A10,MAX(SUMIFS(B3:B10,r,">="&r-1,r,"<="&r+1)))
 
Upvote 1
Solution

Forum statistics

Threads
1,215,341
Messages
6,124,391
Members
449,155
Latest member
ravioli44

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