+ Reply to Thread
Results 1 to 6 of 6

Using IF function several times referencing a Dropdown to calculate a 'minimum' charge

  1. #1
    Registered User
    Join Date
    01-02-2013
    Location
    Toronto, ON, Canada
    MS-Off Ver
    Excel 2010
    Posts
    21

    Question Using IF function several times referencing a Dropdown to calculate a 'minimum' charge

    Hello, New to Excel Forum but have used it as a reference many times.

    I'm trying to create three different cells (Debit, Visa and MasterCard) that calculate a minimum charge based on a minimum 'threshold'. However, the minimum can be applied to Debit, Visa and MasterCard individually, Debit and Credit separately, or all three combined. I have a drop down box referencing four cells: 'Select One' (what I'll leave as the default), 'Debit/Visa/MasterCard', 'Debit/Credit', 'Combined'. elsewhere on the spreadsheet I have formulas that calculate individual charges for rates on Debit, Visa and MasterCard.

    So this is what I want the cells to do in English:
    IF dropdown is 'Select One' then return a blank value, but IF dropdown is 'Debit/Visa/MasterCard' then Debit cell returns the difference between the minimum threshold and the Debit charge while Visa and MasterCard cells do the same with their respective thresholds and charges, but IF dropdown is 'Debit/Credit' then Debit cell returns the difference between the minimum threshold and the Debit charge while Visa (which would rename itself to 'Credit') returns the difference between the minimum threshold and the Visa and MasterCard charges, IF dropdown is 'Combined' then Debit (which would rename itself to 'All Minimums') returns the difference between the minimum threshold and the Debit, Visa and MasterCard charges.

    I've tried so many different ways but I can't get it working! Please Help!

  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,933

    Re: Using IF function several times referencing a Dropdown to calculate a 'minimum' charge

    bpierder, welcome to the forum

    add an extra category to your table (with the calcs for "debit/visa/master" etc) for "select One" and leave it blank.

    then use a vlookup based on your drop-down to find the relevant value from your table

    let me know how you make out?
    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-02-2013
    Location
    Toronto, ON, Canada
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Using IF function several times referencing a Dropdown to calculate a 'minimum' charge

    Quote Originally Posted by FDibbins View Post
    bpierder, welcome to the forum

    add an extra category to your table (with the calcs for "debit/visa/master" etc) for "select One" and leave it blank.

    then use a vlookup based on your drop-down to find the relevant value from your table

    let me know how you make out?
    I'm not sure what you mean. I've used VLOOKUP before but I'm not sure how I would apply it here. I'm going to play around with this and see if I can make it work but can you expand on this?

  4. #4
    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,933

    Re: Using IF function several times referencing a Dropdown to calculate a 'minimum' charge

    perhaps it would be easier to help you if you uploaded a sample workbook, showing what data you are working with, a few examples of what your expected outcome would be, and how you would arrive at that (remove any confidential info if necessary).

    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.

  5. #5
    Registered User
    Join Date
    01-02-2013
    Location
    Toronto, ON, Canada
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Using IF function several times referencing a Dropdown to calculate a 'minimum' charge

    Sweet I got it! I made this array table:

    A B C D E F G H I J
    1 Select One - - - 0 0 0 0 0 0
    2 Debit/Visa/MasterCard Debit Visa MasterCard Debit Treshold Debit Charge Visa Treshold Visa Charge MasterCard Treshold MasterCard Charge
    3 Debit/Credit Debit Credit - Debit Treshold Debit Charge Credit Treshold Credit Charge 0 0
    4 Combined Combined - - - Combined Treshold Combined Charge 0 0 0


    and referenced it in three cells this way:
    =VLOOKUP(A5,A1:J4,2,) has a Minimum Charge of =IF(VLOOKUP(A5,A1:J4,5,)>VLOOKUP(A5,A1:J4,6,),VLOOKUP(A5,A1:J4,5,)-VLOOKUP(A5,A1:J4,6,),0)
    =VLOOKUP(A5,A1:J4,3,) has a Minimum Charge of =IF(VLOOKUP(A5,A1:J4,7,)>VLOOKUP(A5,A1:J4,8,),VLOOKUP(A5,A1:J4,7,)-VLOOKUP(A5,A1:J4,8,),0)
    =VLOOKUP(A5,A1:J4,4,) has a Minimum Charge of =IF(VLOOKUP(A5,A1:J4,9,)>VLOOKUP(A5,A1:J4,10,),VLOOKUP(A5,A1:J4,9,)-VLOOKUP(A5,A1:J4,10,),0)

    And that worked like a charm! Thanks FDibbins!!

  6. #6
    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,933

    Re: Using IF function several times referencing a Dropdown to calculate a 'minimum' charge

    im glad that worked for you

    I was thinking more along the lines of having all that data in the table you posted, in 1 column (A), and then in values for each 1 next to it (B). then you could just use a simple vlookup()

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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