+ Reply to Thread
Results 1 to 4 of 4

Formula/Macro help needed please

  1. #1
    Registered User
    Join Date
    06-03-2022
    Location
    Sussex England
    MS-Off Ver
    2013
    Posts
    2

    Formula/Macro help needed please

    I have a spreadsheet that will contain around 50 rows and 25 columns and a sample is attached.
    I already have top/bottom rules set by conditional formatting. This colour fills the top 12 value cells of each column and gives a total value of those cells.
    What I also would like to do is to be able to sort each column in numerical order but can only do this by sort each column individually which is slow.
    Any suggestions how I may achieve this in an easier way.

    The end result should give me a total for each of the 12 highest values in each column and also indicate which is the lowest counting value in each column. (See Colums B-G)

    Thank you for reading this
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Formula/Macro help needed please

    Do you mean you want 'Umbrella scores'!B1:P33 sorted in place? If so, you'd need to use VBA event handlers, specifically Worksheet_Change for that worksheet to check if a cell in B1:P33 changed, and if so, for each column in B1:P33 intersecting the changed cells, sort that column in place. Can you use VBA?

    Do you want to ignore columns C and D which have fewer than 12 numbers?

    Otherwise, if it'd be OK to use another range for the sorted results (presumably in descending order), then let that sorted range start in R1 and span R1:AF33.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Fill R2 down into R3:R33. Select R1:R33 and fill right into S1:AF33. You could then just sum R1:R12, etc. Also, the values in R12:AF12 would be the 12th largest values, so the thresholds.
    Note: cells not containing numbers in B1:P33 would need to be BLANK, as in, ISBLANK(cell) = TRUE or COUNTA(cell) = 0. Some of the cells in B1:P33 contain, e.g., I30, contain a single space. Such text fubars the R2 formula above. I could modify the formula to ignore text, but IMO it'd be better for the range never to contain anything other than numbers and actually blank cells.
    Last edited by hrlngrv; 06-03-2022 at 08:05 PM.

  3. #3
    Registered User
    Join Date
    06-03-2022
    Location
    Sussex England
    MS-Off Ver
    2013
    Posts
    2

    Re: Formula/Macro help needed please

    Thank you so much for you response. I think I am out of my depth here as I do not know how to use VBA.
    I should perhaps explain a bit more what I am trying to achieve.
    Firstly this is a sports results table and Columns B - G show how I want to end up. Columns H - P are unaltered.
    Each column label represents a team.
    Each team will play many games over a season and all their scores are recorded each time they play.
    Each team's own Top 12 scores give a total point count.
    In order to improve their point count the team would have to score higher their previous lowest counting score.
    As in the example now attached Team B would have to score 11 points or higher in order to remove their previous lowest counting score of 10. Team E, F G are similar.
    Teams C & D have not yet played the minimum 12 games.

    Hope this is a bit clearer.

    Any solution you can offer will be very well received.

    I can always fall back on the old fashioned method of pencil and paper
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,570

    Re: Formula/Macro help needed please

    Hello johnboy45 and Welcome to Excel Forum.
    Perhaps this will help.
    1. The formula that puts the values in least to greatest order is: =IFERROR(AGGREGATE(15,6,B$1:B$33,ROWS(R$1:R1)),"")
    2. The conditional formatting rule that fills cells containing top 12 values per column is: =AND(R1<>"",R1>=R$37)
    3. The conditional formatting rule for the red font is: =R1=R$37
    Note that both rules apply to the entire range (=$R$1:$AF$33)
    Note that both rules reference cells in row 37 which is populated using: =LARGE(R1:R33,12)
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro Formula Needed
    By BOBINIHI in forum Office 365
    Replies: 2
    Last Post: 06-01-2018, 07:34 AM
  2. [SOLVED] Macro needed that's similar to IF formula
    By OpieWinston in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-27-2014, 12:39 PM
  3. Macro Needed To Speed Up A Formula
    By JimmiOO in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-19-2012, 12:13 PM
  4. Difficult Formula/Macro Needed
    By Noobcel in forum Excel General
    Replies: 1
    Last Post: 08-03-2011, 06:29 AM
  5. Formula or Macro needed
    By sai_excel in forum Excel General
    Replies: 1
    Last Post: 08-13-2010, 01:08 AM
  6. Formula or Macro needed?
    By Query in forum Excel General
    Replies: 4
    Last Post: 10-11-2005, 10:03 PM
  7. help needed with formula or macro or both !!
    By richard knight in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-20-2005, 11:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1