+ Reply to Thread
Results 1 to 6 of 6

How to highlight a cell when the sum is greater than another cell reference

  1. #1
    Registered User
    Join Date
    10-04-2013
    Location
    United states
    MS-Off Ver
    Excel 2013
    Posts
    3

    How to highlight a cell when the sum is greater than another cell reference

    Hi guys I hope someone can help me with this.

    I have a cell with a number in it (for example let's say cell A1=102

    I have a row of numbers (b1:b30) and each cell has a random number in it.

    I'm trying to figure out when to "stop counting" once the sum of b1:???>A1

    I'm not sure if there's a formula or a conditional formatting that can be used to know when I have surpassed the reference cell A1.

    Any help?

    help.JPG
    Attached Images Attached Images
    Last edited by basketballbraden13; 10-09-2013 at 04:46 PM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: How to highlight a cell when the sum is greater than another cell reference

    An image attachment almost never has value. Don't attach a screenshot of your Excel file--just attach the file! It's easier than taking a screenshot first and then attaching that.

    It will be much easier to understand your problem if you provide your file. This allows us to see your data, layout, and possibly attach a file with a completed solution.

    The numbers in row B are clearly not random. How are you generating the numbers in that row? Depending on the specifics of what you need this might be done with formulas, might be done with conditional formatting, or might require VBA. It will help if you give more information about what you are doing with the numbers in row B and how you need to use the information about where the total exceeds A1. Is it just for display? Do you have to do calculations on that sum? More context will help get the answer right the first time.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    03-31-2009
    Location
    Childers QLD, Australia
    MS-Off Ver
    Excel 2003, 2007 & 2013
    Posts
    128

    Re: How to highlight a cell when the sum is greater than another cell reference

    Hi,

    I have given your example a try.

    I did need to add another row for the sum.

    See if this helps you.

    Cheers

    TonyB
    Attached Files Attached Files

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: How to highlight a cell when the sum is greater than another cell reference

    Here is a similar solution that does not require the running total row. It highlights all cells until the sum goes over the value in A1. The first number that puts it over the total is not highlighted. My example uses RANDBETWEEN to generate random numbers from 1-15. Hit F9 to re-generate the numbers.

    However, I am still not sure if this is what you mean by "stop counting."
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-04-2013
    Location
    United states
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: How to highlight a cell when the sum is greater than another cell reference

    Thanks guys for your help! I did end up figuring it out by doing a couple IF statements and the conditional formatting that you suggested. Thanks for your help!

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: How to highlight a cell when the sum is greater than another cell reference

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. Replies: 5
    Last Post: 07-13-2013, 04:07 PM
  2. [SOLVED] Highlight the Cell which is greater than Next Friday's Date
    By vigneshwaran in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-27-2012, 07:04 AM
  3. Replies: 2
    Last Post: 10-08-2012, 08:10 AM
  4. [SOLVED] Macro to highlight a cell if greater
    By ISUCyclones in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-06-2012, 04:17 PM
  5. Highlight if Greater/Less then Target Cell
    By CanadianFrodo in forum Excel General
    Replies: 11
    Last Post: 05-20-2012, 02:07 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