Created
May 27, 2024 16:19
-
-
Save ncalm/9975a140f6afbae84b3336adc743a3e8 to your computer and use it in GitHub Desktop.
This Excel LAMBDA function taxes a table of incremental tax brackets and a known tax amount and calculates the income that would produce that tax amount.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GETSALARYFROMTAX = LAMBDA(low, high, rate, | |
LAMBDA(tax, | |
LET( | |
diff, high - low, | |
bracketmax, diff * rate, | |
runsum, SCAN(0, bracketmax, SUM), | |
XLOOKUP( | |
tax, | |
runsum, | |
low + diff * (tax - runsum + bracketmax) / bracketmax, | |
, | |
1 // Match or next largest item | |
) | |
) | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment