Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

If formula to return 0 when same and 1 when different

Posted on 2016-09-28
Medium Priority
76 Views
Hi Experts using excel 2010

I havethe following if formula...

IF(BB19=BA19,0,IF(BC19=BB19,0,IF(BD19=BC19,0,IF(BE19=BD19,0,IF(BF19=BE19,0,1)))))

Which should when the previous date is the same as current date return 0 and when different return 1...cannot get it to work. Keeps on returning 0 all the time.
0
Question by:route217
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 3
• 2
• 2

LVL 32

Expert Comment

ID: 41819526
Maybe this...

``````=IF(OR(BB19=BA19,BC19=BB19,BD19=BC19,BE19=BD19,BF19=BE19),0,1)
``````
0

LVL 27

Expert Comment

ID: 41819530
can u upload a sample file.  the reason you get zero is that in all nested IFS the condition for true is 0 so that would mean that any of these BB19=BA19 BC19=BB19 BD19=BC19 BF19=BE19 are returning true meaning that any of these equal statement are true and therefore it will not reach to the end.
0

LVL 32

Assisted Solution

Subodh Tiwari (Neeraj) earned 1000 total points
ID: 41819531
Another way....
``````=IF(SUMPRODUCT(COUNTIF(BA19:BE19,BA19:BE19))=5,1,0)
``````
0

Author Comment

ID: 41819549
Firstly thanks for the feed back still get a zero.

So.assume row 1
Date 1        Date 2        Date 3       Date 4
Rows 2
01/02/16   02/02/16    02/02/16   03/02/16
Hence end result should be 2 date 1 and 2 are different and 3 and 4..
0

LVL 27

Accepted Solution

ProfessorJimJam earned 1000 total points
ID: 41819574
please see attached.  the result does show 1
Book1.xlsx
0

Author Comment

ID: 41819578
Apologies projimjam..

End result should be 2 hence two date differences. My fault.. sorry.
0

LVL 27

Expert Comment

ID: 41819761
Book1.xlsx
0

Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are â€¦
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Suggested Courses
Course of the Month8 days, 22 hours left to enroll