+ Reply to Thread
Results 1 to 3 of 3

Conditional Formatting - Formula Problem?

  1. #1
    Registered User
    Join Date
    03-25-2013
    Location
    Stafford
    MS-Off Ver
    Excel 2010
    Posts
    5

    Conditional Formatting - Formula Problem?

    I have a spreadsheet with a list of payments made against contracts. Columns A:D display contract_number, contract_value, Payment_date and payment_amount. In column E, there is a formula to sum the payments at each change of contract number: =IF(A2=A3,"",SUM(D$2:D2)-SUM(E1:E$2)). No big problems with this.

    I have also applied some conditional formatting on column E to highlight when the sum in column E (payments) are not equal to the value in column C (contract_value): =AND(E3<>B3,E3<>"")

    So, if the total invoiced against the contract (E3) is different to The contact value (B3) AND there is a value in E3, then apply formatting.

    However, this doesn't seem to be working very well as several of the cells in column E have the formatting applied where the conditions are not being met.

    Help appreciated.

    Ken
    Attached Files Attached Files

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Conditional Formatting - Formula Problem?

    you went into problems with rounding values. (not your fault - just known excel problem).
    The numbers in excel are stored as double precision (some 15 digits shall be acurate)

    see rows 14 and 15 if you use not 2 decimal digits but more:

    HTML Code: 
    of course your rule for conditional formatting returns red, because value in column B is different from E

    The cure (one of possible) - change the CF rule formula to:
    Please Login or Register  to view this content.
    Last edited by Kaper; 01-27-2014 at 01:26 PM.

  3. #3
    Registered User
    Join Date
    03-25-2013
    Location
    Stafford
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Conditional Formatting - Formula Problem?

    Kaper,

    Thank you very much for your help. I didn't know about the precision level. Who would have thought that adding two numbers together would 'introduce an error'.

    Now I am aware of the error, I decided to change the CF to this, which also works:
    HTML 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. [SOLVED] formula problem w/ conditional formatting
    By edwinculanding in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-30-2013, 05:20 AM
  2. [SOLVED] problem with logical formula for conditional formatting
    By nsterng1 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 07-30-2012, 04:59 PM
  3. Conditional Formatting using formula needed for the following problem
    By Deepthik in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-29-2010, 09:41 AM
  4. Conditional Formatting formula problem
    By ddub25 in forum Excel General
    Replies: 3
    Last Post: 01-21-2010, 08:24 AM
  5. Replies: 8
    Last Post: 03-05-2005, 08:06 PM

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