+ Reply to Thread
Results 1 to 19 of 19

IF Formula to calculate banding based on multiple criteria

Hybrid View

  1. #1
    Registered User
    Join Date
    02-01-2018
    Location
    Pickering, North Yorkshire
    MS-Off Ver
    Excel 2016
    Posts
    51

    IF Formula to calculate banding based on multiple criteria

    Hi,

    Please can someone help me with my spreadsheet. I have over 800 lines and have started checking by hand.

    I need a formula to look at the country and depending on the taxable pay (various rates), return the tax banding. I have attached a small snippet which may help. I have popped a formula in column G, but this is merely for the line and not the entire range, please could you have a look and help.

    Many thanks,
    DChar1
    Attached Files Attached Files

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: IF Formula to calculate banding based on multiple criteria

    I'd create lookup table with country column, upper bound of bucket and band.

    Ex:
    England 377701 20%
    England 150000.01 40%
    etc.

    Assuming that table is in T2:V12 range.

    Formula in G9: Copy down.
    =AGGREGATE(15,6,$V$2:$V$12/(($T$2:$T$12=A9)*($U$2:$U$12>=D9)),1)

    Note: I used Over 150k as text. This works since Excel consider all text value to be greater than numeric value.

    See attached.
    Attached Files Attached Files
    "Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    02-01-2018
    Location
    Pickering, North Yorkshire
    MS-Off Ver
    Excel 2016
    Posts
    51

    Lightbulb Re: IF Formula to calculate banding based on multiple criteria

    OMG! That is amazing. I have not even come across Aggregate before. Thank you so much

    I have re-attached the spreadsheet to see if you could help with another part of the same spreadsheet, again I have just attached a small snippet. I initially tried adding another column, to then do the formula, but wondered if you had a better idea?
    Attached Files Attached Files

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: IF Formula to calculate banding based on multiple criteria

    Column E can be simple arithmetic calculation.
    =D25 *(1/(1-A25))

  5. #5
    Registered User
    Join Date
    02-01-2018
    Location
    Pickering, North Yorkshire
    MS-Off Ver
    Excel 2016
    Posts
    51

    Re: IF Formula to calculate banding based on multiple criteria

    CK76 thank you so, so much. You have taught me something new and taught me not to overthink. Cannot rate your reputation enough.

    Thank you.

  6. #6
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: IF Formula to calculate banding based on multiple criteria

    You are welcome and thanks for the rep

    If your issue is solved. Please mark the thread as solved using thread tools found at top of your initial post.

  7. #7
    Registered User
    Join Date
    02-01-2018
    Location
    Pickering, North Yorkshire
    MS-Off Ver
    Excel 2016
    Posts
    51

    Re: IF Formula to calculate banding based on multiple criteria

    Just one thing.... sorry to bother you again.

    Where I am using this as a template, on additional rows that have no data I am getting #Num. So, I don't have to delete the lines to get rid of the error and get my results, how can I tell it to return 0.00.

    I have tried to attach a condensed version of the spreadsheet, but the file is too large still. I have therefore attached a picture.

    Any help will be appreciated.
    Attached Images Attached Images

  8. #8
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: IF Formula to calculate banding based on multiple criteria

    Oh one thing. I think I should have used ">" instead of ">=".

    Formula in G should be...
    =AGGREGATE(15,6,$V$2:$V$12/(($T$2:$T$12=A9)*($U$2:$U$12>D9)),1)

  9. #9
    Registered User
    Join Date
    02-01-2018
    Location
    Pickering, North Yorkshire
    MS-Off Ver
    Excel 2016
    Posts
    51

    Re: IF Formula to calculate banding based on multiple criteria

    Amended; thank you

  10. #10
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: IF Formula to calculate banding based on multiple criteria

    Use IFERROR(formula,0.00)

  11. #11
    Registered User
    Join Date
    02-01-2018
    Location
    Pickering, North Yorkshire
    MS-Off Ver
    Excel 2016
    Posts
    51

    Re: IF Formula to calculate banding based on multiple criteria

    Of course.... That's me over thinking again. Thanks.

  12. #12
    Registered User
    Join Date
    02-01-2018
    Location
    Pickering, North Yorkshire
    MS-Off Ver
    Excel 2016
    Posts
    51

    Re: IF Formula to calculate banding based on multiple criteria

    We are still testing the template, so I will leave the thread open, just in case I need your assistance with any other modifications before I close. I hope that is ok.

  13. #13
    Registered User
    Join Date
    02-01-2018
    Location
    Pickering, North Yorkshire
    MS-Off Ver
    Excel 2016
    Posts
    51

    Re: IF Formula to calculate banding based on multiple criteria

    Hi CK76, I hope you are well.

    You kindly helped me last year with this document and I'm afraid I need your assistance again

    I have updated the bandings and noticed that some of the values are not pulling through. It seems to have a problem with the higher salaries. Either returning no value or 40% when it should be 45% or 46%.

    I don't know whether I am going data blind, but I can't figure out what the error is.

    Please can you help?
    Attached Files Attached Files

  14. #14
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2021
    Posts
    1,017

    Re: IF Formula to calculate banding based on multiple criteria

    Hi dchar1,

    You're returning 0 because the values in the range O2:O13 (in your formula) don't exceed the values in O21 and O22 and hence return FALSE (which Excel interprets as 0). It's a dirty solution, but can you change the upper values (the £125,140.01 value) to something they'll never hit (e.g. £999,999,999)?

    I hope this helps,

    Snook

  15. #15
    Registered User
    Join Date
    02-01-2018
    Location
    Pickering, North Yorkshire
    MS-Off Ver
    Excel 2016
    Posts
    51

    Re: IF Formula to calculate banding based on multiple criteria

    Hi Snook,

    Thanks ever so much for responding.

    My values in O2:O13 do show £125,140.01, see highlighted image:
    Screenshot 2024-09-05 193709.png

    I did try £999,999,999.00 as suggested and it did work, so thank you. I am just confused as to why with the correct value in it won't work. Even, if I change to £125,141.00 it doesn't work.

    #confused

  16. #16
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2021
    Posts
    1,017

    Re: IF Formula to calculate banding based on multiple criteria

    The way the formula works, it's checking whether the values in the 'Upper' column are greater than the value you are looking up from the 'Taxable Pay' column. As £125,140.01 isn't greater than £128,561.44 (cell O21) it returns FALSE. When Excel multiplies that with the ($N$2:$N$13=L21) part of the formula, it treats FALSE as 0 and hence the output is 0. When it calculates the $P$2:$P$13/ part, it is dividing by 0 and the output is an error (#DIV/0). As you've wrapped the formula within an IFERROR statement it turns the resultant error into a 0.

  17. #17
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2021
    Posts
    1,017

    Re: IF Formula to calculate banding based on multiple criteria

    Re your 'I am just confused as to why with the correct value in it won't work. Even, if I change to £125,141.00 it doesn't work.' query, you would need to amend the formula to be >= rather than just > in the ($O$2:$O$13>O21) part of the formula. This is because £125,140.01 isn't greater than £125,140.01 and therefore would return FALSE. If you amended it to greater than or equal to (>=) it would return TRUE.
    Last edited by The_Snook; 09-05-2024 at 03:26 PM.

  18. #18
    Registered User
    Join Date
    02-01-2018
    Location
    Pickering, North Yorkshire
    MS-Off Ver
    Excel 2016
    Posts
    51

    Re: IF Formula to calculate banding based on multiple criteria

    Ah, OK I'm with you.

    Thank you ever so much for help. Really appreciate it

  19. #19
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2021
    Posts
    1,017

    Re: IF Formula to calculate banding based on multiple criteria

    You're welcome mate, I'm happy to help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] calculate based on multiple criteria
    By sanjuss2 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-08-2023, 01:01 AM
  2. [SOLVED] Formula to Calculate Event Credits based on multiple criteria
    By flamethrower128 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-05-2022, 12:31 AM
  3. [SOLVED] Calculate Banding based on 2 variables
    By Burt_100 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-02-2016, 06:32 PM
  4. [SOLVED] Calculate SUM based on multiple criteria (row and column)
    By Flyinace2000 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-29-2012, 12:33 PM
  5. Calculate Based On Multiple Criteria
    By Kumara_faith in forum Excel General
    Replies: 5
    Last Post: 02-03-2012, 04:06 PM
  6. Calculate based on multiple criteria
    By day92 in forum Excel General
    Replies: 2
    Last Post: 03-10-2011, 08:11 PM
  7. Replies: 8
    Last Post: 03-21-2008, 12:09 PM

Bookmarks

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