Excel If Help

Closed
Abby Hung - 15 Mar 2010 à 11:39
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 - 15 Mar 2010 à 13:05
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 28 January 2010 Status Contributor Last seen 5 May 2022 766
15 Mar 2010 à 13:05
=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)