+ Reply to Thread
Results 1 to 9 of 9

Help with "IF" function

  1. #1
    Registered User
    Join Date
    11-22-2019
    Location
    Hull, England
    MS-Off Ver
    10
    Posts
    1

    Help with "IF" function

    Hello,

    For starters I am a beginner with excel so forgive me if I come across stupid!

    Let's pretend below is my excel sheet, I want a formula/function to show that if my "Actual" figure is less than my "Target" figure it will show the "Result" figure as a negative number and the colour red and likewise, if the "Actual" figure is more than my "Target" figure it will show the "Result" figure as a positive number and the colour green.

    Any ideas please?

    Thanks

    Target 100 100
    Actual 50 120
    Result -50 20

  2. #2
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Help with "IF" function

    Welcome on the Forum.


    A
    B
    C
    1
    Target
    100
    100
    2
    Actual
    50
    120
    3
    Result
    -50
    20


    A
    B
    C
    1
    Target
    100
    100
    2
    Actual
    50
    120
    3
    Result
    =B2-B1
    =C2-C1


    Colouring set by Conditional Formatting. You can find it on Home/Styles section / Conditional Formatting / Highlight cells rules / Greater Than and Less Than then you can choose colour.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Help with "IF" function

    Or, you could use a Custom Number Format:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Format | Format Cells... | Number (tab) | Custom (at the bottom) | Type: (box) [Green]#,##0;[Red]-#,##0
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Help with "IF" function

    Quote Originally Posted by TMS View Post
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Very useful. I did not know about it.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Help with "IF" function

    @KOKOSEK: You're welcome. Thanks for the rep.

    I was only really aware of it in relation to red for negative values but I decided to experiment and it worked

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Help with "IF" function

    @Thor27470: Thanks for the rep

  7. #7
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Help with "IF" function

    Quote Originally Posted by TMS View Post
    I was only really aware of it in relation to red for negative values but I decided to experiment and it worked
    I was also try something else and it appear that [Blue] also works. So it looks like excel knows some colours by name.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Help with "IF" function

    @KOKOSEK: see this great page on formatting: https://exceljet.net/custom-number-formats

    Nice section on formatting with colours.

  9. #9
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Help with "IF" function

    exceljet.net in general is great. Thanks.

+ 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: 02-05-2019, 12:03 AM
  2. [SOLVED] Column X-Ref list - Sheet1 Col A "pages", Col B:FL "Req" to Sheet2 ColA "req", ColB "page"
    By excel-card-pulled in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-07-2017, 09:30 AM
  3. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  4. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  5. [SOLVED] Variable "sheet-name" and "range-name" wanted in INDEX/MATCH-function
    By Fiebuls in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-01-2012, 04:09 PM
  6. [SOLVED] Please add a "sheet" function like "row" and "column" functions
    By Spreadsheet Monkey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-08-2005, 12:15 PM
  7. [SOLVED] Replace "insert function" with "edit formula" button in fourmula b
    By 13brian in forum Excel General
    Replies: 0
    Last Post: 08-24-2005, 04:05 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