+ Reply to Thread
Results 1 to 5 of 5

Nested if

  1. #1
    Registered User
    Join Date
    01-25-2017
    Location
    Fiji
    MS-Off Ver
    2013
    Posts
    21

    Exclamation Nested if

    Capture.JPG

    please refer to image for better understanding

    I have 4 columns Total Amount(E2) and Tax Code(F2) Customs and Sales Tax Rate (g2)
    There are 2 tax codes 1 and 2
    i want to calculate the Customs and Sales Tax Rate using this criteria

    if Tax code ($f3) = 1 and Value for total Amount($e3) in the equal to or greater then than value in cell $M$5 and equal to or less then the Value in cell $N$5 if yes then $e3 multiply by $0$5
    Else if Tax code ($f3) = 1 and Value for total Amount($e3) in the equal to or greater then than value in cell $M$4 and equal to or less then the Value in cell $N$4 if yes then $e3 multiply by $0$4
    Else if Tax code ($f3) = 2 and Value for total Amount($e3) in the equal to or greater then than value in cell $M$11 and equal to or less then the Value in cell $N$11 if yes then $e3 multiply by $0$11
    Else if Tax code ($f3) = 2 and Value for total Amount($e3) in the equal to or greater then than value in cell $M$10 and equal to or less then the Value in cell $N$10 if yes then $e3 multiply by $0$10
    Else if Tax code ($f3) = 2 and Value for total Amount($e3) in the equal to or greater then than value in cell $M$9 and equal to or less then the Value in cell $N$9 if yes then $e3 multiply by $0$9

    i tried this just to test however didnt work. i tried a few combinations was unsuccessful
    =if($f3=1 And($E3=>$M$5, $ $E3=>$N$5),$E3*$O$5,if($f3=1 And($E3=>$M$4, $ $E3=>$N$4),$E3*$O$4))

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Nested if

    To best describe or illustrate your problem you would be better off attaching a dummy workbook (not a pic). The workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    01-25-2017
    Location
    Fiji
    MS-Off Ver
    2013
    Posts
    21

    Re: Nested if

    Use a Nested IF function to calculate the customs and sales tax rate to be added on each company
    contract based on the Total Cost of the imported goods and his Tax Status (A Tax status of 2 means
    the company enjoys preferential custom and sales tax treatment where as a Tax status of 1 implies
    non-preferential custom and sales tax treatment). This formula should use relative or absolute
    references where appropriate. (10 marks)
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Nested if

    Perhaps in G3

    Please Login or Register  to view this content.
    Regards

    Dav

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,414

    Re: Nested if

    If you are open to an alternative to nested IF INDEX/MATCH could work here. This approach is not a common one. There is a seldom used 4th argument in INDEX called area_num. It works well in situations like this where there are multiple lookup tables. It permits selection of the relevant table (area_num) through the Tax Status codes 1,2. The row and column arguments then pertain only to that area.

    The explanation is more complicated than the actual usage.

    In Name Manager find the non-contiguous range named 'Status'. =Sheet1!$M$9:$O$11,Sheet1!$M$4:$O$5

    Note that each area is comma separated. They are numbered left to right 1, 2 ... n. In this case there are of course only 1 and 2.

    (Note also that Sheet1!$M$9:$O$11,Sheet1!$M$4:$O$5 can be directly entered in the first argument of INDEX however the entire set must be enclosed in () or you will get a "too many arguments" error.)

    The formula in G3 and filled down is
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Try it and if you have questions about it feel free to ask. Once understood I believe you'll find it is simpler than nested IF.

    Does this help?
    Attached Files Attached Files
    Dave

+ 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] Nested vlookup or nested IFAND function?
    By jeptik in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-11-2017, 02:27 AM
  2. Nested IF statement error. Nested True statement is not triggering
    By Lucas7040 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-26-2016, 11:41 AM
  3. Easier Way To Decipher Nested Nested IF's
    By Vladamir in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-06-2015, 03:37 PM
  4. [SOLVED] Nested Sumif's or how to sum data based on nested criteria
    By dlietz in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-07-2014, 11:36 AM
  5. How to reduces Nested IF code(144 Nested IF) to achive same functionality
    By jobseeker in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-09-2014, 09:45 AM
  6. Replies: 0
    Last Post: 10-01-2012, 05:54 AM
  7. help on a nested countif/nested if formula
    By vickiemc in forum Excel General
    Replies: 2
    Last Post: 08-13-2008, 08:29 AM

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