Help on a formula

Copper Contributor

I am trying to write an IF statement for a column, and I will use the same formula for the entire column.   Example:  =IF(L$55,<=H$57,(K2*.10),(K2*.12)).  L55 is YTD gross pay, H57 is the tax bracket of the least amount, if the gross pay is now higher than H57, it is to go to the next percentage of 12%. My problem is that when L55 is greater than H57, it will calculate K2*.12 but, it changes all the previous cells above it to K2*.12 instead of keeping it as K2*.10.  How do I keep the previous cells from changing values once the statement reaches false? This is for a personal weekly payroll/deduction sheet. 

2 Replies

@Michele70 

 

It's hard to visualize what your full spreadsheet looks like here, so I've made some assumptions. If this isn't correct, could you please post a copy of your actual, just making sure no real names are included.

 

Essentially, you want to have a YTD column next to the weekly pay, a YTD column that stores YTD pay on a weekly basis, and compare that figure with the tax limit.

 

I also gave you another way to do the tax calculation, a way that avoids "hard-coding" the tax percentage in the formula itself. This involves creating a Tax Table...and using VLOOKUP to determine the tax rate. Using a table like this enables you, if and when the tax rate changes, to simply change the table; no need to go edit every formula.

 

 

@Michele70 I highly recommend @mathetes comments and suggestions but to try and answer your question for learning purposes, the problem is that you are using 2 FIXED cells: L$55 and H$57, and L$55 changes as the year goes on.  What I'm guessing you really want is something more like SUM(L$2:L2) instead of L$55 so that it will dynamically sum column L only up to the corresponding Row instead of using L$55 which I'm assuming is the SUM of all the Rows.