+ Reply to Thread
Results 1 to 3 of 3

How do I write a script for + or - results

  1. #1
    Registered User
    Join Date
    06-03-2012
    Location
    USA Florida
    MS-Off Ver
    Excel 2010
    Posts
    4

    How do I write a script for + or - results

    I need to write a script based on the value of a cell in relationship to another cell....

    Example:

    Day 1. Money total is $40.50
    Day 2. Money total is $45.00. So based on this, the value is +$ 4.50 (results in black)

    or it could be this;

    Day 1. Money total is $75.00
    Day 2. Money total is $73.50. So based on this, the value is -$1.50 (which should be in red)

    Any help will be appreciated.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: How do I write a script for + or - results

    You will need a formula like this to calculate the difference:

    = A2 - A1

    where I have assumed your Day 1 value is in A1 and the Day 2 value is in A2.

    You need to format the cell containing that formula as currency, and there is a pre-defined format to show negative numbers in red.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    06-03-2012
    Location
    USA Florida
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: How do I write a script for + or - results

    Pete_UK,

    Thanks for the help. It is exactlly what I wanted.

    Rich

+ 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