+ Reply to Thread
Results 1 to 4 of 4

Replace nested IF with other formulae...

  1. #1
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Replace nested IF with other formulae...

    Hi
    Ive got one question... just for interest...

    A friend of mine is Fiscal Agent. He works at state tax administration. He had this formula at work to calculate income tax.
    Please Login or Register  to view this content.
    I've reduced it. Now it looks like.

    Please Login or Register  to view this content.
    They're almost the same but I didn't use AND() function.

    Now, my question is can this formula be replaced with SUMPRODUCT() or CHOOSE/MATCH ...I observed similar replacement but I don't remember details of that formulae.
    Last edited by contaminated; 08-08-2009 at 04:05 PM.
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Replace nested IF with other formulae...

    Given the resulting formulae are not consistent for all bands (ie % changes, reduction of value pre * % not consistent, final addition etc) I would say no, not in this instance (IMO).

    FWIW be aware that Sumproduct is not an efficient formula per se, it is "processed" in the same way as a "traditional" CSE Array and we know that we would generally try to avoid using Arrays if there are non-array alternatives (sometimes an Array is more succinct of course) ... you could possibly use CHOOSE but I don't really see how it would be more efficient than what you have already.

    A Sumproduct appraoch is generally used as an alternative to an embedded IF approach where there is some level of consistency in a tiered system, say for example I wanted to calculate a commission value where I band the % according to sale price, eg:

    First £500 @ 5%, Next 500 @ 10% and everything thereafter at 20%

    So for a sale of £1600 I would get 500 @ 5%, 500 @ 10% and 600 @ 20% ... as an alternative to embedded IF I could use:

    =SUMPRODUCT(--(saleprice>{0,500,1000}),saleprice-{0,500,1000},{0.05,0.05,0.1})

    this approach is obviously useful when you have lots of tiers (note the % in the final inline array are incremental - ie 2nd rate 5% higher than 1st rate, 3rd rate 10% higher than 2nd rate)

    Is that what you were referring to ?
    Last edited by DonkeyOte; 08-07-2009 at 06:19 PM. Reason: added tiered sumproduct example

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,719

    Re: Replace nested IF with other formulae...

    If you want short try

    =(K19>=75)*(K19*35%-MIN(2000,K19)*21%-(K19<=200)*10.5)
    Last edited by daddylonglegs; 08-07-2009 at 06:44 PM.

  4. #4
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Replace nested IF with other formulae...

    Thanx for explanation DonkeyOte. Very cognitively. I appreciate a lot.
    Thanx for provided formula daddylonglegs. Cool formulae...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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