Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
slot guy
 
Posts: n/a
Default Retuning a column number for a specific value

I'm trying to figure out how to have a formula return the column number from
a maximum value in a row. I've tried using =column(max(a1:c1)) to return the
column number but it errors out. Can anyone offer a suggestion?

Thanks
  #2   Report Post  
bj
 
Posts: n/a
Default

try
=sumproduct(--(range =max(range)),Column(range)

note if there can be several equal maxs this won't work.

in this case try
=match(max(range),range,0)+(column number at start of range)-1

"slot guy" wrote:

I'm trying to figure out how to have a formula return the column number from
a maximum value in a row. I've tried using =column(max(a1:c1)) to return the
column number but it errors out. Can anyone offer a suggestion?

Thanks

  #3   Report Post  
bj
 
Posts: n/a
Default

the "--(" changes the logical true false to a numerical 1 0.
if you had column(C3) the response would be 3 since column C is the 3rd
column
in the formula
sumproduct(--(A1:B1=max(A1:B1),Column(A1:B1))
would be similar to

(A1=max(A1:B1)*Column(A1) +(B1=max(A1:B1))*column(B1
orif B1 were greater than A1
(0)*(1)+(1)*(2) = 2

"slot guy" wrote:

bj,
Thank you for the formula. I uesed the first one since I'm looking for
unique date with no repeats. Can you please tell me what the "--" does in the
function? Also, I don't understand how the column number is actualy returned
using the column function. The function description just states that "column"
returns the column number of a reference. It doesn't ask for any criteria to
use to pick from a reference. Can you explain?


"bj" wrote:

try
=sumproduct(--(range =max(range)),Column(range)

note if there can be several equal maxs this won't work.

in this case try
=match(max(range),range,0)+(column number at start of range)-1

"slot guy" wrote:

I'm trying to figure out how to have a formula return the column number from
a maximum value in a row. I've tried using =column(max(a1:c1)) to return the
column number but it errors out. Can anyone offer a suggestion?

Thanks

  #4   Report Post  
slot guy
 
Posts: n/a
Default

bj,
Thank you for the formula. I uesed the first one since I'm looking for
unique date with no repeats. Can you please tell me what the "--" does in the
function? Also, I don't understand how the column number is actualy returned
using the column function. The function description just states that "column"
returns the column number of a reference. It doesn't ask for any criteria to
use to pick from a reference. Can you explain?


"bj" wrote:

try
=sumproduct(--(range =max(range)),Column(range)

note if there can be several equal maxs this won't work.

in this case try
=match(max(range),range,0)+(column number at start of range)-1

"slot guy" wrote:

I'm trying to figure out how to have a formula return the column number from
a maximum value in a row. I've tried using =column(max(a1:c1)) to return the
column number but it errors out. Can anyone offer a suggestion?

Thanks

  #5   Report Post  
Harlan Grove
 
Posts: n/a
Default

bj wrote...
....
note if there can be several equal maxs this won't work.

in this case try
=match(max(range),range,0)+(column number at start of range)-1

....

Or

=COLUMN(INDEX(range,MATCH(MAX(range),range,0)))

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running total w/2 columns - Excel Anna / Ideal Excel Worksheet Functions 14 August 10th 05 04:28 PM
Get Column Letter from Column Number Gary Brown Excel Worksheet Functions 7 June 11th 05 02:08 AM
Lookup Table Dilemma Karen Excel Worksheet Functions 2 June 10th 05 08:22 PM
Count number of occurences in 1 column only if something in anothe Wenster Excel Worksheet Functions 2 February 7th 05 09:58 PM
how do I find an average number of specific words in a column cashgrfx New Users to Excel 7 January 6th 05 04:44 PM


All times are GMT +1. The time now is 09:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"