Find max value from 3 cells, return text, but 2 max values same!

  • Thread starter Struggling in Sheffield
  • Start date
S

Struggling in Sheffield

Hi,
I'm using a simple formula to find and return the maximum value from 3
compared columns (N, Q & T) and place that max value in column U (same row).
Equation in column U is:

=MAX(N3,Q3,T3)

SK17 EC3 PL2 Max Text
N O P Q R S T U V

3 6 5 1 6
4 6 3 3 6
5 5 5 2 5
6 1 4 1 4
7 5 3 5 5
8 2 7 0 7
9 1 1 1 1
10 9 0 4 9

That works fine but my problem is I want to return a text note in column V
based on which column has supplied the max value. However, if the same max
value is in 2 or even all 3 of the checked columns, I need column V to simple
display an "X", as illustrated below.

SK17 EC3 PL2 Max Text
N O P Q R S T U V

3 6 5 1 6
SK17
4 6 3 3 6
SK17
5 5 5 2 5
X
6 1 4 1 4
EC3
7 5 3 5 5
X
8 2 7 0 7
EC3
9 1 1 1 1
X
10 9 0 4 9
SK17

I'm OK until two max values match but then it all falls apart.
As always any advice will be gratefully received.
Thanks,
Steve.
 
S

Shane Devenshire

Hi,

Show us the formula you currently have which works for one max value.
 
S

Struggling in Sheffield

Hi,
I deleted it (!) though I think it was this simple beasty below:

=IF(N3=U3,"SK17",IF(Q3=U3,"EC3",IF(T3=U3,"PL2")))

All this did of course is return the first occuring high value if there were
2 or more. I've chewed over many variations to give an "X" if two (or more)
equal max values occur but to no avail.

:

Hi,
I'm using a simple formula to find and return the maximum value from 3
compared columns (N, Q & T) and place that max value in column U (same row).
Equation in column U is:

=MAX(N3,Q3,T3)

SK17 EC3 PL2 Max Text
N O P Q R S T U V
3 6 5 1 6
4 6 3 3 6
5 5 5 2 5
6 1 4 1 4
7 5 3 5 5
8 2 7 0 7
9 1 1 1 1
10 9 0 4 9

That works fine but my problem is I want to return a text note in column V
based on which column has supplied the max value. However, if the same max
value is in 2 or even all 3 of the checked columns, I need column V to simple
display an "X", as illustrated below.

SK17 EC3 PL2 Max Text
N O P Q R S T U V
3 6 5 1 6 SK17
4 6 3 3 6 SK17
5 5 5 2 5 X
6 1 4 1 4 EC3
7 5 3 5 5 X
8 2 7 0 7 EC3
9 1 1 1 1 X
10 9 0 4 9 SK17

I'm OK until two max values match but then it all falls apart.
As always any advice will be gratefully received.
Thanks,
Steve.
 
J

jat

do the empty columns need to be there? if the three columns could have data
side by side, instead of in N, Q, T, the following will get you started:

=IF(COUNTIF(N3:p3,Q3)>1,"X",IF(N3=Q3,"SK17",IF(O3=Q3,"EC3",IF(P3=Q3,"PL2"))))

hope that helps,

doing my bit
jat
 
S

Struggling in Sheffield

Hi jat,
Sorry but the 'empty' columns aren't empty, I've just omitted other data to
simplify the problem.
Cheers,
Steve.
 
S

Struggling in Sheffield

Managed to find a solution myself.

For those who are interested, U3 contains max value from three compared
cells (N3,Q3 & T3) using formula:
=MAX(N3,Q3,T3)

Inserted another column between U & V.

Formula in new column (row 3):
=LARGE(N3:Q3:T3,2)
This finds the second largest value from the three compared cells.

Formula then in the "text" column (was column V but now W)
=IF(V3=U3,"X",IF(N3=U3,"SK17",IF(Q3=U3,"EC3",IF(T3=U3,"PL2"))))

The largest value from the three compared cells (N3,Q3,T3) is placed in U3
except when the largest value isn't unique (2nd largest value (in V3) is the
same), in which case an "X" is returned.
Finished off by hiding the newly inserted column.
Cheers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top