+ Reply to Thread
Results 1 to 5 of 5

Help to calculate prize

  1. #1
    Registered User
    Join Date
    08-22-2011
    Location
    The Hague, Holland
    MS-Off Ver
    Excel 2007
    Posts
    6

    Help to calculate prize

    Hi guys

    I was wondering if someone could help me with this challenage.
    I am looking for a formula to calculate a prize based on the prefix (telephonenumber breakout).
    These breakouts are to call international.

    See below the prefix and rate example template.
    It works like this, if the prefix is mentioned al the digits after the prefix would be ignored and the rate for the mentioned prefix would be charged.
    So someone is dialing 932523658923 the rate of 0.1808 would be charged but if someone is calling 937352685984 the rate of 0.1466 woud be charged beceause it prefix is mentioned in the system.

    I dont have the prize for all prefixes, so i need to match the prize based on the existing prize.

    So in below example they are sorted first on name and then on prefix. (93)
    Some of the prefixes can go up to 12 digits.

    Work sheet

    Afghanistan 93​ 0.1808​
    Afghanistan 935​
    Afghanistan Mobile 937​ 0.1691​
    Afghanistan Mobile 9373​ 0.1466​
    Afghanistan Mobile AT 9375​
    Afghanistan Mobile AWCC 9370​ 0.1663​
    Afghanistan Mobile AWCC 93702​
    Afghanistan 933​

    Result after formula
    935 should be 0.1808
    9375 should be 0.1691
    93702 would 0.1663
    933 would be 0.1808

    Hope somebody could help me

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,621

    Re: Help to calculate prize

    Hi
    please read the yellow banner

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

    Re: Help to calculate prize

    I agree with Pepe, but think the word prize should be rate or price.


    Also it is easy to search the start of a number to look up the price, but the problem is you have varying length strings, which could be accommodated in a nested if statement, however if your real question involves more than the 7 options that you have now, this would prove to be problematic.

    Is every string you match 3 4 or 5 characters?

    if so iferror(vlookup((left,cell,5),range of characters and tarrifs,2,false),iferror(vlookup((left,cell,4),range of characters and tarrifs,2,false),vlookup((left,cell,3),range of characters and tarrifs,2,false)))


    may be the solution you are looking for you return the rate with a vlookup matching 5 characters, if this fails, you try with 4 if this fails you try with 3. Lots of internet pages on how vlookup works
    https://exceljet.net/excel-functions...ookup-function

  4. #4
    Registered User
    Join Date
    08-22-2011
    Location
    The Hague, Holland
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Help to calculate price

    Hi the formula is not working,

    I have attached a sample excel sheet where we can put in the formula, can you help ?
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,981

    Re: Help to calculate prize

    Once I select the enable editing button and the formulas display results, then then values produced by the formula look to be correct based on the examples in post #1.
    It may help if you tell us the values that the formula should produce in each cell containing the formula.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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] Intersection reminder - for nobel prize:)
    By oneandtwo in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-27-2014, 08:50 AM
  2. Prize Draw with Macro
    By sacen in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-23-2014, 06:56 PM
  3. Prize Won - Count of Prize
    By vinaynaran in forum Excel General
    Replies: 2
    Last Post: 07-31-2009, 09:13 AM
  4. Help a dumb **** & win a prize
    By pricey in forum Excel General
    Replies: 1
    Last Post: 04-27-2006, 05:45 AM
  5. [SOLVED] Prize Calculation
    By shahbaze in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-15-2005, 06:45 PM
  6. [SOLVED] Prize Calculation
    By prize calculation in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-15-2005, 06:45 PM

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