+ Reply to Thread
Results 1 to 4 of 4

Calculating points based on Date, Document Number and Total Sold

  1. #1
    Registered User
    Join Date
    08-20-2012
    Location
    Glasgow
    MS-Off Ver
    Excel 2007
    Posts
    77

    Calculating points based on Date, Document Number and Total Sold

    Hi,

    I have five fields - item, document number, date of sale, total sold, points total.

    I want to calculate the points total.

    Each item has a points total associated with it. However, if the product was purchased before 14/11/2012 it is given a single points figure and if it is purchased after it is given a double points figure. The single points and double points are named ranges. I want to multiply the total sold by the points for that item, depending on whether it is single or double - based on when it was purchased.

    I only want the calculation to be performed for products that have a document number beginning with 2. If it begins with a 3 then I don't want a calculation performed.

    Any help would be appreciated, attached is a sample of the spreadsheet.

    Thanks

    David
    Attached Files Attached Files

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Calculating points based on Date, Document Number and Total Sold

    hi David. assuming there's only documents starting with 2 & 3, try:
    =IF(LEFT(B2,1)="3","",D2*(IF(C2+0<DATE(2012,11,14),VLOOKUP(A2,SinglePoints,2,0),VLOOKUP(A2,DoublePoints,2,0))))

    *Edited after seeing Pete's formula & realised Column C is not an actual date
    Last edited by benishiryo; 12-20-2012 at 11:53 AM.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,732

    Re: Calculating points based on Date, Document Number and Total Sold

    Put this in E2:

    =IF(LEFT(B2)<>"2",0,IF(--C2<--"14/11/2012",VLOOKUP(A2,SinglePoints,2,0),VLOOKUP(A2,DoublePoints,2,0))*D2)

    then copy down.

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    08-20-2012
    Location
    Glasgow
    MS-Off Ver
    Excel 2007
    Posts
    77

    Re: Calculating points based on Date, Document Number and Total Sold

    thats great, thanks!

    david

+ 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