+ Reply to Thread
Results 1 to 8 of 8

Comparing to cells of data

  1. #1
    Forum Contributor
    Join Date
    07-30-2012
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    139

    Question Comparing to cells of data

    I have an excel workbook that I'm using as a verifying tool to make sure that the weight of the product we recieve is the same as the weight of the product we paid for. When we recieve new product, the net, gross, and tare weights are on the outside label from our distributor. those weights are entered into the workbook. We then measure all of those weights again ourselves and enter them into different columns in the same workbook.

    What I'd like to do is setup something that checks the incoming gross weight vs our measured gross weight and colors the cell red or gives some sort of an alert if there is more than x% difference. and then do the same for net weight and tare weight.

    What is the best way to do this?

    Thanks!

    A sample of what my workbook looks like... Kind of:

    Lot#--RGrosswt--RTarewt--RNetwt--SGrosswt--STarewt--SNetwt
    22756-----100------4 ------96---------95--------8-------87

    !Alert, underweight tote

    RGrosswt - Recieved Gross weight
    RTarewt - Recieved Tare Weight
    RNetwt - Recieved Net Weight

    SGrosswt - Shipped Gross Weight
    STarewt - Shipped Tare Weight
    SNetwt - Shipped Net Weight
    Last edited by brharrii; 07-30-2012 at 06:14 PM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Comparing to cells of data

    brharrii,

    I think what you're looking for is conditional formatting.
    Attached is an example workbook based on the criteria you described.
    On cell G4, I have applied the following conditional formatting rule:
    Please Login or Register  to view this content.
    G2 is the SNetwt, D2 is the RNetwt. So G2/D2 is the percentage of Snetwt/RNetwt. To get how much of a difference it is, take the absolute value (the ABS function) and subtract the result from 1. Now compare it to your x%. I assumed x% to be 5%, which is why if the % difference is > .05 (5%) then it applies the conditional formatting. I set the formatting to simply color the font text red.

    To get to conditional formatting in excel 2007 and 2010, go to the Home tab on the ribbon -> Condtional Formatting -> Manage Rules. Make sure you have cell G2 selected when you do that, or select "This Worksheet" to show formatting rules for.
    Attached Files Attached Files
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Comparing to cells of data

    PM I received from OP:
    Quote Originally Posted by brharrii
    Thank you for responding to my post. Your solution is exactly what i was looking for!

    For some reason my response posts wont take right now as I've written 3 of them and none are showing on that thread.

    Anyways, I wanted to thank you for your assistance and ask you if you knew if it was possible to add formatting for multiple cells quickly or if they all needed to be done one at a time.

    I have approximately 100 cells that I need to create the same formatting. Do I need to do them all one at a time? or is there a way to copy the conditional formatting rules and apply them to several cells in the same column at once?

    thanks!


    brharrii,

    I'm glad the solution is working for you. In order to apply the conditional formatting to a range of cells all at once:
    Go to the Home tab on the ribbon -> Conditional Formatting -> Manage Rules...
    Select "This Worksheet"
    Change the range of cells for the desired formatting rule's "Applies to" section.

  4. #4
    Forum Contributor
    Join Date
    07-30-2012
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    139

    Re: Comparing to cells of data

    I tinkered with that a little bit but it ended up highlighting the entire range of cells when one of them was out of conformity instead of just the one. I must have done soemthing wrong.

  5. #5
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Comparing to cells of data

    brharrii,

    Ah, I forgot to update the formula to allow the rows to change when the format is applied to other rows. Change the conditional format formula to:
    Please Login or Register  to view this content.

    The only thing that changed was the removal of the absolute row references (there are no $ symbols in front of the row numbers).

  6. #6
    Forum Contributor
    Join Date
    07-30-2012
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    139

    Re: Comparing to cells of data

    awesome, that worked perfectly! Thank you very much

  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Comparing to cells of data

    @ brharrii

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  8. #8
    Forum Contributor
    Join Date
    07-30-2012
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    139

    Re: Comparing to cells of data

    Thanks Cutter, sorry about that! I mark these appropriately in the future!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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