We’d like to remind Forumites to please avoid political debate on the Forum.

This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

Conditional Formatting Excel Query

Cotta
Cotta Posts: 3,667 Forumite
Hi All,


I have a formula driven cell set to turn red if it is at any value other than "0". My problem is the cell currently appears red even though the value in the cell is "0". However looking at the exact figure in the cell it appears to be 0.00000003, is there any way around this?


Thanks

Comments

  • grumbler
    grumbler Posts: 58,629 Forumite
    Part of the Furniture 10,000 Posts Name Dropper Photogenic
    edited 22 March 2016 at 3:27PM
    Well, 0.00000003 isn't 0, is it?
    If it's a calculated value, either ROUND(...) it as you need or in conditional formatting "Use a formula to determine which cells to format" with the formula, e.g. ABS(...)<0.0001.
  • Cotta
    Cotta Posts: 3,667 Forumite
    Ok, below is my formula and it work perfect and is initially returning "0", how do I add the "Round" function to this in order to ensure that decimal points are ignored?


    =GETPIVOTDATA("Total Fees",$A$6,"Financial Quarter","Q1")-SUMIF('Matter Data'!C2:C1048576,'RBS Summary Pivots'!B7,'Matter Data'!AQ2 :Q1048576)
  • GunJack
    GunJack Posts: 11,864 Forumite
    Part of the Furniture 10,000 Posts Name Dropper Photogenic
    Cotta wrote: »
    probably

    =ROUNDDOWN(GETPIVOTDATA("Total Fees",$A$6,"Financial Quarter","Q1")-SUMIF('Matter Data'!C2:C1048576,'RBS Summary Pivots'!B7,'Matter Data'!AQ2 :Q1048576))

    this will round down to zero
    ......Gettin' There, Wherever There is......

    I have a dodgy "i" key, so ignore spelling errors due to "i" issues, ...I blame Apple :D
  • grumbler
    grumbler Posts: 58,629 Forumite
    Part of the Furniture 10,000 Posts Name Dropper Photogenic
    edited 22 March 2016 at 3:25PM
    You don't want to use ROUNDDOWN because, say, -0.0000000000001 will be rounded to -1.

    The correct way of doing this is ROUND(......, 2) for rounding to pence or ROUND(......, 0) for rounding to pounds.
  • Cotta
    Cotta Posts: 3,667 Forumite
    grumbler wrote: »
    You don't want to use ROUNDDOWN because, say, -0.0000000000001 will be rounded to -1.

    The correct way of doing this is ROUND(......, 2) for rounding to pence or ROUND(......, 0) for rounding to pounds.



    What way is this incorporated into the above formula? I'm rounding to pound.
  • grumbler
    grumbler Posts: 58,629 Forumite
    Part of the Furniture 10,000 Posts Name Dropper Photogenic
    =ROUND(GETPIVOTDATA("Total Fees",$A$6,"Financial Quarter","Q1")-SUMIF('Matter Data'!C2:C1048576,'RBS Summary Pivots'!B7,'Matter Data'!AQ2 :Q1048576),0)
  • Le_Kirk
    Le_Kirk Posts: 24,865 Forumite
    Part of the Furniture 10,000 Posts Photogenic Name Dropper
    ....... or in your conditional formatting formula just put "<1" as that will cover zero and 0.00000003. Of course it will also be a problem if there is a possibility of negative numbers as -1 is also <1.
  • Cotta
    Cotta Posts: 3,667 Forumite
    grumbler wrote: »
    =ROUND(GETPIVOTDATA("Total Fees",$A$6,"Financial Quarter","Q1")-SUMIF('Matter Data'!C2:C1048576,'RBS Summary Pivots'!B7,'Matter Data'!AQ2 :Q1048576),0)

    Perfect, that worked a treat, thank you so much.
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 351.7K Banking & Borrowing
  • 253.4K Reduce Debt & Boost Income
  • 454K Spending & Discounts
  • 244.7K Work, Benefits & Business
  • 600.1K Mortgages, Homes & Bills
  • 177.3K Life & Family
  • 258.4K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16.2K Discuss & Feedback
  • 37.6K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.