LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
nj nj is offline
external usenet poster
 
Posts: 7
Default Custom function to find top sellers

OK, I give. I've worked on this off and on for days, I've hunted and
hunted for other posts that might be close enough to get me there, but
no luck. Is anyone up for helping with this?

I'm trying to set up a custom function to return all the members of a
team who made the top sales number. Here's some sample data:

Team Color Sales
Team A Red 87
Team A Blue 87
Team A White 29
Team A Black 28
Team B Yellow 83
Team B Green 4
Team B Teal 2
Team B Silver 1
Team C Tan 121
Team C Gray 119
Team C Brown 4
Team C Purple 2
Team D Aqua 94
Team D Gold 94
Team D Pink 29
Team D Orange 1

Now, I found and have used the max(if()) function to find that top
sale number per team,
=MAX(IF((Team=F$20),Sales,0)) -- array function, so entered with Ctrl
+Shft+Enter
(Which reminds me, I've used sumproduct for all the other
calculations because we find people break array functions done this
way, but DANGED if I can figure out how to work Max with Sumproduct.
Grrr.)

Oh, yes, forgot -- I've set up the dynamic named ranges as well, so
Team =OFFSET(Sheet1!$A$2,0,0,COUNTA(Sheet1!$A:$A)-1,1)
Sales =OFFSET(Sheet1!$A$2,0,2,COUNTA(Sheet1!$A:$A)-1,1)

So the Max results look like this:

Team A Team B Team C Team D
Max Sales 87 83 121 94

Now, if there could only be one top seller, I would have my solution
because I discovered Ctrl+Shft+Enter allow Match to work with arrays,
and I have the formula
=INDEX($A$2:$C$17,MATCH(F20&F21,$A$2:$A$17&$C$2:$C $17,0),2) -- array
function, so entered with Ctrl+Shft+Enter

so now it looks like this:

Team A Team B Team C Team D
Max Sales 87 83 121 94
Top Seller(s) Red Yellow Tan Aqua

But what I *really* need is:

Team A Team B Team C Team D
Max Sales 87 83 121 94
Top Seller(s) Red, Blue Yellow Tan Aqua, Gold

Is anyone up for messing with that?

I'd be very grateful if anyone were so inclined.

NJ
 
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
Trying to count the number of buyers or sellers for a given month. djcampanelli Excel Worksheet Functions 4 September 18th 09 02:00 AM
Error when adding custom help file to custom function Sabotuer99 Excel Programming 1 July 19th 08 01:46 PM
Creating a custom function to interpret another custom engine func Ryan Excel Programming 0 March 3rd 08 07:18 PM
can't find custom function code nathan Excel Worksheet Functions 7 November 2nd 05 10:15 PM
How can I find the last time a custom function is called ? James Shoffit Excel Programming 1 December 6th 04 05:52 PM


All times are GMT +1. The time now is 10:01 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"