Little tricky

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
1,213
Office Version
  1. 2010
Platform
  1. Windows
  2. Mobile
I have 7 ‘main’ columns (headings: Col1, Col2, Col3, Col4, Col5, Col6, Col7) with values either of 100 or 200.
Each of the above ‘main’ columns has ‘adjacent’ columns to itself (headings: Adj1, Adj 2, Adj 3, Adj 4, Adj 5, Adj 6, Adj 7).

Output required: (in O2:O999) satisfying following conditions

O2= Check ‘main’ columns in row#2 containing value 100. Get the HIGHEST value of the corresponding ‘adjacent’ columns. If there are more than 1 highest value, then get the HIGHEST value of the corresponding ‘adjacent’ columns which appears at the right hand side.

Similarly for O3:O999

Thanks for the help rendered in advance.

Sheet1

ABCDEFGHIJKLMNO
1Col1Adj1Col2Adj2Col3Adj3Col4Ad4Col5Adj5Col6Adj6Col7Adj7ANSWER
2200252.23100254.65100256.89200251.02200248.98200260.99200299.99256.89
3100785.99200287.44100265.88100785.992001000.36100785.99200201.02785.99

<colgroup><col style="FONT-WEIGHT: bold; WIDTH: 30px"><col style="WIDTH: 34px"><col style="WIDTH: 49px"><col style="WIDTH: 34px"><col style="WIDTH: 49px"><col style="WIDTH: 34px"><col style="WIDTH: 49px"><col style="WIDTH: 34px"><col style="WIDTH: 56px"><col style="WIDTH: 34px"><col style="WIDTH: 56px"><col style="WIDTH: 34px"><col style="WIDTH: 49px"><col style="WIDTH: 34px"><col style="WIDTH: 49px"><col style="WIDTH: 62px"></colgroup><tbody>
</tbody>
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
If there are more than 1 highest value, then get the HIGHEST value of the corresponding ‘adjacent’ columns which appears at the right hand side.

Why does it matter? I think I understand what you meant to say but please explain.
 
Last edited:
Upvote 0
Maybe ...

Row\Col
A​
B​
C​
D​
E​
F​
G​
H​
I​
J​
K​
L​
M​
N​
O​
P​
1​
Col1
Adj1
Col2
Adj2
Col3
Adj3
Col4
Ad4
Col5
Adj5
Col6
Adj6
Col7
Adj7
ANSWER
2​
200​
252.23​
100​
254.65​
100​
256.89​
200​
251.02​
200​
248.98​
200​
260.99​
200​
299.99​
256.89​
O2: {=MAX(IF(A2:M2=100, B2:N2))}
3​
100​
785.99​
200​
287.44​
100​
265.88​
100​
785.99​
200​
1000.36​
100​
785.99​
200​
201.02​
785.99​
 
Upvote 0

Excel 2010
ABCDEFGHIJKLMNO
1Col1Adj1Col2Adj2Col3Adj3Col4Ad4Col5Adj5Col6Adj6Col7Adj7ANSWER
2200252.23100254.65100256.89200251.02200248.98200260.99200299.99256.89
3100785.99200287.44100265.88100785.992001000.36100785.99200201.02785.99
Sheet10
Cell Formulas
RangeFormula
O2{=MAX(--(OFFSET(B2:N2,0,-1)=100)*B2:N2)}
O3{=MAX(--(OFFSET(B3:N3,0,-1)=100)*B3:N3)}
Press CTRL+SHIFT+ENTER to enter array formulas.


Works on your sample data, but I'm not sure about the other condition you stated.
 
Upvote 0
Sandeep bhai try this across O2:O999=MAX(IF(--(A2:M2=100)=1,OFFSET(A2:M2,0,1))) .... (Ctrl+Shift+Enter)
Worked for me for -ve MAX values also
Not considering column N for offset as it is 'Adjacent' and not 'Main'...
 
Upvote 0
O2:O999=MAX(IF(--(A2:M2=100)=1,OFFSET(A2:M2,0,1))) .... (Ctrl+Shift+Enter)

I'll make my requirement 'real'. Please bear with me....

The 7 'main' columns are not in A to M but they are 'scattered' like column A is actually column LD; column C is MA; column E is column MH; column G is column NE; column I is column NP; column K is column NZ & column M is column OY.
The 'adjacent' columns are next to these 'main' columns.
To identify these 7 'main' columns, row#1 contains a value 10 which is like for column LD LD1=10; & so on till column OY OY1=10.

Any more clarification is welcomed.
 
Upvote 0
I want to add excel's 'on/off switch' (in the row#1) to get the MAX value. For ON, Y is punched in row#1 else blank.

Sheet1

ABCDEFGHIJKLMNO
1YAdj1YAdj2YAdj3 Ad4 Adj5YAdj6 Adj7ANSWER
2200252.23100254.65100256.89200251.02200248.98200260.99200299.99256.89
3100785.99200287.44100265.88100900.882001000.36100785.99200201.02785.99

<colgroup><col style="FONT-WEIGHT: bold; WIDTH: 30px"><col style="WIDTH: 34px"><col style="WIDTH: 49px"><col style="WIDTH: 34px"><col style="WIDTH: 49px"><col style="WIDTH: 34px"><col style="WIDTH: 49px"><col style="WIDTH: 34px"><col style="WIDTH: 56px"><col style="WIDTH: 34px"><col style="WIDTH: 56px"><col style="WIDTH: 34px"><col style="WIDTH: 49px"><col style="WIDTH: 34px"><col style="WIDTH: 49px"><col style="WIDTH: 62px"></colgroup><tbody>
</tbody>

How to get the HIGHEST value of the corresponding ‘adjacent’ columns considering the 'on/off switch'?

 
Upvote 0

Forum statistics

Threads
1,215,065
Messages
6,122,945
Members
449,095
Latest member
nmaske

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