ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   OR'ing to IF Statements (https://www.excelbanter.com/excel-worksheet-functions/67635-oring-if-statements.html)

carl

OR'ing to IF Statements
 
I am trying to "OR" these together.

=IF(AND(H5="sell";K5<=D5);(K5-D5)*L5*100;(K5-D5)*L5*100)

=IF(AND(H6="buy";K6<=C6);(C6-K6)*L6*100;(C6-K6)*L6*100)

Thank you in advance.

[email protected]

OR'ing to IF Statements
 
"carl" wrote:
I am trying to "OR" these together.
=IF(AND(H5="sell";K5<=D5);(K5-D5)*L5*100;(K5-D5)*L5*100)
=IF(AND(H6="buy";K6<=C6);(C6-K6)*L6*100;(C6-K6)*L6*100)


To begin with, you comma (","), not semicolon (";") as a
separator.

I do not understand what it is you want to "OR" and what
outcome you are looking for when the OR() returns true v.
false. I suggest that you start by writing your requirements
in English, something like:

if "this condition" or "that condition", then "this", else "that"

My suspicion is that you do not want "OR" at all, but perhaps
nested "IFs", for example:

if "this condition", then "this"
else if "that condition", then "that", else "another"

Based on that assumption, I wonder if the following is the
solution you are looking for:

=IF(H5="sell", (K5-D5)*L5*100, IF(H6="buy", (C6-K6)*L6*100, ""))


All times are GMT +1. The time now is 02:54 PM.

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