# Nested If statements / logic statements

1. ## Nested If statements / logic statements

So here's the problem I need to buy a guitar for 3 out of every 4 people. Across the X axis (representing time) is the quantity of people.

Ex- 1 0 2 3 2 2 4 4 3 4 5 4 4 3 5 4 4 4 1 (people)

So the output that I would expect using the ground rules and assumptions that I have is

1 0 2 2 1 2 3 3 2 3 4 3 3 2 4 3 3 3 1 (guitars)

I lay in a guitar for each of the 1st 3 people out of a group of 4. The next year may contain a count from the prior year(s). Notice for the first 3 values they stay the same but once you reach the 4th value (year 4) it's decremented by 1 to account for not reaching 4 with the SUM of people in the prior years.

I need a formula that is drillable and allows me to change the amount of people per year and modifies the output (guitars) based on the qty and lay-in. Any questions don't hesitate to ask.

2. ## Re: Nested If statements / logic statements

Here's one way:
``Please Login or Register  to view this content.``
The formula in B2 and copied across is =CEILING(SUM(\$B1:B1) * 3 / 4, 1) - SUM(\$A2:A2)

3. ## Re: Nested If statements / logic statements

Thanks mang! That's way easier than what I was trying to do. Now gotta go learn what that function does.

You rock!

4. ## Re: Nested If statements / logic statements

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1