+ Reply to Thread
Results 1 to 6 of 6

Trying to get the right formula on Parameter Code with a range and value

  1. #1
    Registered User
    Join Date
    11-10-2014
    Location
    bath
    MS-Off Ver
    2007
    Posts
    21

    Trying to get the right formula on Parameter Code with a range and value

    Please help as spent hours trying to figure this out.

    1) I've got six different bands, the first band is "Single person no children (say band A)", the second band is "Single person one children (say band B)"
    2) The first two income range is if less than £100 then 90% discount, if less than £200 then 85% discount.
    3) So trying to apply a formula that will give me correct discount which I can then use else where to calculate a deduction off a bill.

    So far I have this =IF(A2<100,"90%",IF(A2<200,"85%",IF(A2<300,"80%",IF(A2<350,"70%",IF(A2<400,"50%",IF(A2<400,"","0"))))))

    This is fine for band A but some how I wish to change the formula which will include the other bands. Not sure if a look up table is required.


    Please can someone give demonstration on the first two bands with the first two discount ranges and I'll be able to hopefully adapt the rest.

    many thanks

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Trying to get the right formula on Parameter Code with a range and value

    First, remove quotes round the % values as these will be TEXT not numeric

    =IF(A2<100,90%,IF(A2<200,85%,IF(A2<300,80%,IF(A2<350,70%,IF(A2<400,50%,IF(A2<400,"",0))))))

    Attach a sample workbook.

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Trying to get the right formula on Parameter Code with a range and value

    Duplicate post removed.

  4. #4
    Registered User
    Join Date
    11-10-2014
    Location
    bath
    MS-Off Ver
    2007
    Posts
    21

    Re: Trying to get the right formula on Parameter Code with a range and value

    Thank you for quick reply - second band would be

    =IF(A2<150,90%,IF(A2<250,85%,IF(A2<350,80%,IF(A2<400,70%,IF(A2<450,50%,IF(A2<450,"",0))))))

    So how do I combine the two formulas into one?

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Trying to get the right formula on Parameter Code with a range and value

    I created 2 named ranges called "Band_A" and "Band_B" : the underscore is required as you cannot have a blank in the name.

    I then used the following formula:

    =VLOOKUP(F2,INDIRECT(SUBSTITUTE(G2," ","_")),2,1)

    F2: income
    G2: "Band A" without quotes but including blank

    See examples in the attached
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-10-2014
    Location
    bath
    MS-Off Ver
    2007
    Posts
    21

    Re: Trying to get the right formula on Parameter Code with a range and value

    Thank you very much everybody - I will play with this

+ 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. Specific cells in worksheets, but in a range parameter of a formula
    By Look, More, What in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 01-20-2015, 06:01 PM
  2. Replies: 2
    Last Post: 10-06-2014, 08:15 AM
  3. Replies: 0
    Last Post: 10-06-2014, 07:35 AM
  4. [SOLVED] Shift horizontal range of text based on a parameter, copy formula down across
    By David Brown in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-15-2013, 10:14 AM
  5. Cells or range as UDF parameter
    By geoB in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2011, 05:06 PM
  6. passing a range as a parameter
    By bigsmooth in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-15-2009, 07:03 PM
  7. Replies: 1
    Last Post: 06-24-2008, 03:44 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