Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Excel Formula  (Read 3349 times)

0 Members and 1 Guest are viewing this topic.

morgre

  • Guest
Excel Formula
« on: March 23, 2011, 01:30:42 AM »
I may be dumb! I have been trying to work out a formula for the following eg: If A1 is less than A2 it equals the difference, however if A1 is equal to or greater than A2 it equals zero.

soybean



    Genius
  • The first soybean ever to learn the computer.
  • Thanked: 469
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows 10
Re: Excel Formula
« Reply #1 on: March 23, 2011, 09:31:28 AM »
Your notion of how you want A1 to work is not based on sound logic.  Based on what you've said, A1 and A2 contain data, not formulas.  Yet, you go on to say you want A1 to change based on the relationship between A1 and A2.  That doesn't make sense.  You need to use A3 or some other cell for a formula that evaluates A1 and A2.  Try that and then post back if you need help with the formula.

reddevilggg



    Expert

    Thanked: 69
  • Experience: Beginner
  • OS: Windows 7
Re: Excel Formula
« Reply #2 on: March 23, 2011, 11:05:50 AM »

I thought it was more along the lines of -

If A1<A2 then A2 minus A1, else equals 0
11 cheers for binary !

Salmon Trout

  • Guest
Re: Excel Formula
« Reply #3 on: March 23, 2011, 11:18:37 AM »
I thought it was more along the lines of -

If A1<A2 then A2 minus A1, else equals 0

It's all in the Excel help.

IF (condition, cell contents if condition is true, cell contents if condition is false)

Below, as you can tell, the formula is in cell A3


BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: Excel Formula
« Reply #4 on: March 23, 2011, 01:05:56 PM »
either use IF, as noted above:

=IF(A1<A2,A2-A1,0)

or if you want to be clever:

=(A2-A1)*(A2>A1)
I was trying to dereference Null Pointers before it was cool.

pum1

  • Guest
Re: Excel Formula
« Reply #5 on: April 02, 2011, 06:03:48 AM »
you can see excel tutorial here....Ad Link Removed.
« Last Edit: April 02, 2011, 07:32:59 AM by patio »

Salmon Trout

  • Guest
Re: Excel Formula
« Reply #6 on: April 02, 2011, 06:15:25 AM »
pum1's link is to a "tutorial" that is actually a disguised advertisement for a commercial report generation package.