How to optimize complex nested IF statements for tax calculations in Google Sheets

I’m struggling with this complicated nested IF formula and need help making it cleaner. The formula calculates tax based on different income brackets for different fiscal years. Here’s what I have:

=IF($B$2="2025",
  IF($B$15<250001, 0,
    IF($B$15<=650000, ($B$15-250000)*0.05,
      IF($B$15<=950000, ($B$15-650000)*0.10+20000,
        IF($B$15<=1150000, ($B$15-950000)*0.15+50000,
          IF($B$15<=1450000, ($B$15-1150000)*0.20+80000,
            ($B$15-1450000)*0.30+140000))))),
  IF($B$2="2026",
    IF($B$15<350001, 0,
      IF($B$15<=750000, ($B$15-350000)*0.05,
        IF($B$15<=1150000, ($B$15-750000)*0.10+20000,
          IF($B$15<=1550000, ($B$15-1150000)*0.15+40000,
            IF($B$15<=1950000, ($B$15-1550000)*0.20+60000,
              IF($B$15<=2350000, ($B$15-1950000)*0.25+80000,
                ($B$15-2350000)*0.30+100000))))))),
    0)

This formula is getting too messy and hard to maintain. Is there a simpler way to handle multiple tax brackets across different years? Maybe using lookup tables or other Google Sheets functions?

break it into separate helper columns - one for each tax year calculation. way easier to debug when things go wrong. i use one column for 2025 tax, another for 2026, then a simple IF statement to pick the right one based on your year cell. keeps each formula manageable instead of that monster nested formula you’ve got.

I’ve been through this tax calculation hell before. Skip the nested IFs - they’re a nightmare to maintain. Use VLOOKUP with helper tables instead.

Set up separate tables for each tax year: bracket minimums, rates, and cumulative tax amounts. Then use INDEX/MATCH or VLOOKUP with TRUE to find the right bracket. For your situation, I’d create tables with bracket thresholds and use INDEX to grab the correct rate based on income.

You could also try SUMPRODUCT with conditional logic - it handles progressive tax calculations pretty elegantly.

The big win? When tax rates change, you just update the lookup table. No rebuilding complex formulas. Plus adding new tax years doesn’t turn your formulas into monsters.

Try combining SWITCH and SUMPRODUCT instead of nested IFs. SWITCH handles year selection way cleaner, and SUMPRODUCT’s perfect for progressive calculations. I used this same setup for payroll tax calcs - works great. Set up arrays for your brackets, rates, and thresholds. Then let SUMPRODUCT crunch the cumulative tax across all brackets. Your formula gets way shorter and actually makes sense when you look at it later. Also try named ranges for your tax tables. I call mine “Tax2025_Brackets” and “Tax2025_Rates” - makes updates super easy and cuts down on copy-paste errors. Plus Google Sheets handles array operations way faster than those crazy nested conditionals.