Solved

Nested If formula?

Posted on 2013-12-17
4
157 Views
Last Modified: 2013-12-17
One of my colleagues needs to flag each record that has 3 or more consecutive days with a 1 in a column.  Attached simple spreadsheet demonstrates what he's trying to get.
Tricky.xlsx
0
Comment
Question by:kerikeri
4 Comments
 
LVL 22

Accepted Solution

by:
Flyster earned 300 total points
ID: 39725628
In the first 2 rows, C2 and C3, use this formula:

=IF(SUM(C2:C4)>2,"OK","")

In C4, use this:

=IF(OR(SUM(B2:B4)>2,SUM(B4:B6)>2,SUM(B3:B5)>2),"OK","")

Copy this formula the rest of the way down.

Flyster
Tricky.xlsx
0
 
LVL 50

Assisted Solution

by:teylyn
teylyn earned 100 total points
ID: 39725639
Hello,

are the values always 1 or can there be other numbers? This one, starting in C2 and copied down will cater for any value greater than 0:

=IF(OR(AND(D1="OK",B2>0),AND(B2>0,B3>0,B4>0)),"OK","")

cheers, teylyn
0
 
LVL 43

Assisted Solution

by:Saqib Husain, Syed
Saqib Husain, Syed earned 100 total points
ID: 39725699
Taking teylyn's formula a step further, this formula will find any non-zero number repeated consecutively three or more.

=IF(OR(AND(D1="OK",B2>0),AND(B2>0,B3=B2,B4=B2)),"OK","")
0
 

Author Closing Comment

by:kerikeri
ID: 39725703
Hey thanks, each of your suggestions was helpful in the final solution.  My colleague is impressed!  Thanks for your quick response, much appreciated.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Excel - Scroll Speed 3 25
Copy the formula in excel 8 28
Macro 3 20
Top 10 with duplicates in Excel Table 4 13
A2 = A1 That kind of cell reference is relative.  If you copy it from A2 to B2, then B2 will get this: B2 = B1 That's all fine and good, but if you then insert a new row above row 2, you'll find: A3 = A1 B3 = B1 This is intentional. …
INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now