ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   how do I write this formula? (https://www.excelbanter.com/excel-discussion-misc-queries/45010-how-do-i-write-formula.html)

djarcadian

how do I write this formula?
 

cell1+cell2<cell3 then (cell1+cell2) X 0.062
cell1+cell2cell3 then (cell3-cell1) X 0.062


How would I write this formula?


--
djarcadian
------------------------------------------------------------------------
djarcadian's Profile: http://www.excelforum.com/member.php...o&userid=15877
View this thread: http://www.excelforum.com/showthread...hreadid=466937


MrShorty


IF(condition,value_if_true,value_if_false)

=IF(cell1+cell2<cell3,(cell1+cell2)*.062,(cell3-cell1)*.062) Note that
your problem statement doesn't specify what to do if cell1+cell2=cell3.
I've put this condition in with the case where cell1+cell2cell3. Adapt
as needed.


--
MrShorty
------------------------------------------------------------------------
MrShorty's Profile: http://www.excelforum.com/member.php...o&userid=22181
View this thread: http://www.excelforum.com/showthread...hreadid=466937


djarcadian


I just realized that if cell1 is greater than cell3 then the results
should be zero. How would I account for that?


--
djarcadian
------------------------------------------------------------------------
djarcadian's Profile: http://www.excelforum.com/member.php...o&userid=15877
View this thread: http://www.excelforum.com/showthread...hreadid=466937


MrShorty


Nest the above IF function inside of a another IF function
=IF(cell1cell3,0,IF(...)) Note that Excel is limited to 7 nested
IF's, so if your decision tree has many more branches to it, you'll
need to come up with another approach.


--
MrShorty
------------------------------------------------------------------------
MrShorty's Profile: http://www.excelforum.com/member.php...o&userid=22181
View this thread: http://www.excelforum.com/showthread...hreadid=466937


djarcadian


Thanks for your help! :)


--
djarcadian
------------------------------------------------------------------------
djarcadian's Profile: http://www.excelforum.com/member.php...o&userid=15877
View this thread: http://www.excelforum.com/showthread...hreadid=466937



All times are GMT +1. The time now is 08:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com