Formula Help - racheting

Excel1990

New Member
I would really appreciate help with the following formula as I just can't get it to work.

For each failure during a month I get charged 10
If I fail three months in a row I get charged and extra 50%, so 15 per failure.

If I fail again in the next month I get an additional 50% on top, so it's now 22.5 per failure.

If I don't fail then it automatically goes back to being charged 10.

3 or more consecutive months of failure incur the 50% premium, increasing by 50% each failure.

 Jan Feb Mar Failures 1 2

<tbody>
</tbody>

I need the formula to be in the total for the year column, totally all months, including any premiums for 3 consecutive failures.

Eric W

MrExcel MVP
Welcome to the forum!

I don't blame you for pulling your hair out, this is a toughie! About the only way I see to do it via formulas is with a helper row. Consider this:

Put the B3 formula in and drag to the right. Then the O3 formula is a basic SUM. If you don't want to see the individual months, you can hide that row and just include the SUM in a location of your choosing.

I can vaguely picture a way to do it in one cell, but it would be enormously complicated. The other option would be to write a User-Defined Function in VBA which would not be too hard if you want to go that route.

Eric W

MrExcel MVP
Looks like I had a slight goof, the formula should be:

=B2*CHOOSE(COLUMN(B2)-AGGREGATE(14,6,COLUMN(\$A2:A2)/(N(OFFSET(\$A2,0,COLUMN(\$A2:A2)-COLUMN(\$A2)))=0),1)+1,0,10,10,15,22.5,33.75,50.63,75.94,113.91,170.86,256.29,384.43,576.65)

The second month should also be 10.

Excel1990

New Member
Thank you so so so so much!

Excel1990

New Member
Looks like I had a slight goof, the formula should be:

=B2*CHOOSE(COLUMN(B2)-AGGREGATE(14,6,COLUMN(\$A2:A2)/(N(OFFSET(\$A2,0,COLUMN(\$A2:A2)-COLUMN(\$A2)))=0),1)+1,0,10,10,15,22.5,33.75,50.63,75.94,113.91,170.86,256.29,384.43,576.65)

The second month should also be 10.

If I had scenario like this but for 5 years (still split out with one column per month) and the premium was applied on an annual basis, how could I do that.

I would need to include a sum of the 12 months into the formula. So if the sum of year 1 is over 0, and the sum of year 2 is over 0, then the sum of year 3 will incur a 50% premium?

Eric W

MrExcel MVP
I think you'd want to make a summary table like this:

The amounts in row 2 go out for 60 columns (5 years). Then put the formula in B5 and copy to the right to get the annual totals. Then you can use the same basic formula from before in B6 (adapted for the different location) and copy that to the right.

1,078,444
Messages
5,340,322
Members
399,368
Latest member
Sataman

This Week's Hot Topics

• Problem with Radio Button's format control
I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
• Last Display on userform to a Listbox
[CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
• Rename and move files to a new location
Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
• Help with True/False Formula
Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
• Clear extra characters from a provided range of cells
Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
• Help with Current and highest streaks
Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...