Excel If Help

Closed
Abby Hung - Mar 15, 2010 at 11:39 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Mar 15, 2010 at 01:05 PM
Hello,
I am having trouble with my excel spreadsheet. I want to do an if function but I also want the formula to do a calculation at the same time. For example


if cell A2 is 300

I want to have a formula which will be if A2 is over three hundred then A2 minus thee hundred. If it is below three hundred then three hundred minus A2

Thanks alot!
Related:

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Mar 15, 2010 at 01:05 PM
=IF(A2>300, A2-300, 300-a2)

Alternatively this will do the same (as it seem you just care for absolute value)

=abs(a2-300)
0