Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default A new excel challenge

Hi folks,

I've run into a situation where I'm not sure what to do with it.

I have seven columns: A B C D F X and POP

beneath the letter colums are totals which can be of values 0 through
11.

What I ultimately want to do is have a formula in the pop cell
corresponding to each row of data which finds the maximum value and
shows the column name corresponding to it.

Following is an example of what I'd like POP to reflect based on
sample data:

A B C D F X POP
2 0 0 7 2 0 D
3 2 0 2 4 0 F
6 3 2 0 0 0 A

etc...

If anyone can give me an idea of which route to follow I'd appreciate
it.

Regards

Ben/ND
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default A new excel challenge

are the seven columns adjacent and these are labels found in row 1? So the
columns involved are A to G?

What about duplicate maximum values.

Looking for formula or macro?

--
Regards,
Tom Ogilvy

"Nick Danger" wrote in message
...
Hi folks,

I've run into a situation where I'm not sure what to do with it.

I have seven columns: A B C D F X and POP

beneath the letter colums are totals which can be of values 0 through
11.

What I ultimately want to do is have a formula in the pop cell
corresponding to each row of data which finds the maximum value and
shows the column name corresponding to it.

Following is an example of what I'd like POP to reflect based on
sample data:

A B C D F X POP
2 0 0 7 2 0 D
3 2 0 2 4 0 F
6 3 2 0 0 0 A

etc...

If anyone can give me an idea of which route to follow I'd appreciate
it.

Regards

Ben/ND



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default A new excel challenge

Nick,

Try this formula

=CHAR(MATCH(MAX(A2:F2),A2:F2,0)+64)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Nick Danger" wrote in message
...
Hi folks,

I've run into a situation where I'm not sure what to do with it.

I have seven columns: A B C D F X and POP

beneath the letter colums are totals which can be of values 0 through
11.

What I ultimately want to do is have a formula in the pop cell
corresponding to each row of data which finds the maximum value and
shows the column name corresponding to it.

Following is an example of what I'd like POP to reflect based on
sample data:

A B C D F X POP
2 0 0 7 2 0 D
3 2 0 2 4 0 F
6 3 2 0 0 0 A

etc...

If anyone can give me an idea of which route to follow I'd appreciate
it.

Regards

Ben/ND



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default A new excel challenge

The following macro will do the job, or you could rewrite it as a user
defined function:

Sub FindMaxCol()
Const Alph As String = "ABCDFX" 'The column labels you gave
Dim MaxCol As Long 'The col with the highest value so far
Dim MaxVal As Long 'The highest value so far
Dim RowIndex As Long 'The row of the current cell
Dim ColIndex As Long 'The colimn of the current cell

For RowIndex = 2 To Range("A65536").End(xlUp).Row 'go from row 2 to
last row
MaxVal = 0 'Highest val found so far
MaxCol = 1 'Col of highest value
For ColIndex = 1 To 6 'Examine each cell in current row
If Cells(RowIndex, ColIndex) MaxVal Then
'Cell is max so far so save its value and col number
MaxVal = Cells(RowIndex, ColIndex)
MaxCol = ColIndex
End If
Next ColIndex 'Look at next col in this row
'Convert col number to col label & save it
Range("G" & RowIndex) = Mid(Alph, MaxCol, 1)
Next RowIndex 'Look at next row
End Sub



On Thu, 13 Oct 2005 13:20:05 -0400, Nick Danger
wrote:

Hi folks,

I've run into a situation where I'm not sure what to do with it.

I have seven columns: A B C D F X and POP

beneath the letter colums are totals which can be of values 0 through
11.

What I ultimately want to do is have a formula in the pop cell
corresponding to each row of data which finds the maximum value and
shows the column name corresponding to it.

Following is an example of what I'd like POP to reflect based on
sample data:

A B C D F X POP
2 0 0 7 2 0 D
3 2 0 2 4 0 F
6 3 2 0 0 0 A

etc...

If anyone can give me an idea of which route to follow I'd appreciate
it.

Regards

Ben/ND


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
Excel formula - Anyone up for a challenge? NEHicks Excel Discussion (Misc queries) 6 December 8th 09 11:47 AM
Excel 2002 Challenge fp944s2 Excel Discussion (Misc queries) 2 June 30th 07 01:14 PM
A challenge for an Excel Master... wahiggin Excel Discussion (Misc queries) 9 June 3rd 06 01:44 PM
A Challenge (Linking word and Excel) Mr M Walker[_2_] Excel Programming 1 July 25th 05 09:33 AM
Challenge...Excel Chart to Power Point calculus87[_5_] Excel Programming 1 July 3rd 04 06:02 PM


All times are GMT +1. The time now is 03:05 PM.

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

About Us

"It's about Microsoft Excel"