ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Two TRUE to one FALSE statement (https://www.excelbanter.com/excel-worksheet-functions/125687-two-true-one-false-statement.html)

bluebird

Two TRUE to one FALSE statement
 
Would like to create a formula that can return one of two true outcomes vs.
one false. For example:

if date2 (c2) < date1 (b2), then "early",
if date2 (c2) = date1 (b2), then "on time",
if date2 (c2) date2 (b2), or if %(d2)<1, then "late".

Can this be done? Any help greatly appreciated!

Bob Phillips

Two TRUE to one FALSE statement
 
=IF(C2<B2,"Early",IF(C2=B2,"On time","Late"))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"bluebird" wrote in message
...
Would like to create a formula that can return one of two true outcomes

vs.
one false. For example:

if date2 (c2) < date1 (b2), then "early",
if date2 (c2) = date1 (b2), then "on time",
if date2 (c2) date2 (b2), or if %(d2)<1, then "late".

Can this be done? Any help greatly appreciated!




bj

Two TRUE to one FALSE statement
 
not sure what you mean by %(d2)<1 but
=if(or(c2b2,d2<.01),"late",if(c2<b2,"early","on time"))
adjust the d2 reference as needed

"bluebird" wrote:

Would like to create a formula that can return one of two true outcomes vs.
one false. For example:

if date2 (c2) < date1 (b2), then "early",
if date2 (c2) = date1 (b2), then "on time",
if date2 (c2) date2 (b2), or if %(d2)<1, then "late".

Can this be done? Any help greatly appreciated!


[email protected]

Two TRUE to one FALSE statement
 
bluebird wrote:
Would like to create a formula that can return one of two true outcomes vs.
one false. For example:
if date2 (c2) < date1 (b2), then "early",
if date2 (c2) = date1 (b2), then "on time",
if date2 (c2) date2 (b2), or if %(d2)<1, then "late".
Can this be done?


Your logic is a little unclear. I interpret your last condition to
mean that even if c2 <= b2 (the first two conditions), you consider it
"late" if d2 < 1. Therefo

=if(or(c2b2, d2<1), "late", if(c2<d2), "early", "on time"))

Note that we do not need to explicitly test if(c2=d2) for the "on time"
result. That is implied by the left-to-right ordering of the tests,
namely it is not c2b2 and it is not c2<b2.


[email protected]

Two TRUE to one FALSE statement
 
Errata....

I wrote:
=if(or(c2b2, d2<1), "late", if(c2<d2), "early", "on time"))


As soon as I hit Send, I realized there is a typo. That should be
written:

=if(or(c2b2, d2<1), "late", if(c2<d2, "early", "on time"))



All times are GMT +1. The time now is 07:24 PM.

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