+ Reply to Thread
Results 1 to 5 of 5

Need help with formula for counting packets of scratch tickets

  1. #1
    Registered User
    Join Date
    08-26-2016
    Location
    Colorado Spring, CO
    MS-Off Ver
    MS Office 2013
    Posts
    2

    Need help with formula for counting packets of scratch tickets

    Hello, I am new here and hope that someone out there can assist me with my formula. I currently use an excel formula that will count a packet of scratch tickets. Packets vary depending on dollar amount of the ticket. So the formula below that I can currently using is for a 2 dollar ticket which contains 100 tickets per packet. The problem is that let's say I sell all of that packet and start a new packet the same day, it is not properly counting the new tickets sold on the same day.

    So let's say on this day, I sell the last 5 tickets of the current pack and open a new pack and sell 3 more tickets. My result at the end of the day when I type in the ticket number of 003 for my total sold should read 16 dollars. 5 from previous pack and 3 from the new pack. Tickets start with 000 and go to 099 on this pack.

    D3 will the the last number recorded from the day before so in this case that number would be 95. D5 will be the current day end in which I sold 3 so the number would be 003.

    =IF(AND(ISBLANK(D5)=TRUE,D5=""),"",IF(AND(ISBLANK(D5)=FALSE,D5>D3),(D5-D3)*2,IF(AND(ISBLANK(D5)=FALSE,D5=D3),0,IF(AND(ISBLANK(D5)=TRUE,D5>=0),(100-D3)*2,IF(AND(ISBLANK(D5)=FALSE,D5<>0),(100-D3+D5)*2,IF(AND(ISBLANK(D5)=FALSE,D5>=0),(100-D3)*2,"-"))))))

    If anyone can help with this, it would be fantastic. What I get sometimes is a total count of 205. So it is counting one whole additional pack plus the 5 that were sold the day before.

    Thanks in advance

  2. #2
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: Need help with formula for counting packets of scratch tickets

    Please attach a sample file so we could take a look. it's easier to do it in excel of course
    If I've helped U pls click on d *Add Reputation

  3. #3
    Valued Forum Contributor mahju's Avatar
    Join Date
    11-27-2010
    Location
    Pakistan, Faisalabad
    MS-Off Ver
    Excel 2010 plus
    Posts
    730

    Re: Need help with formula for counting packets of scratch tickets

    Hi
    Tickets starts from 000 and go to 099

    So if you start new packet and sold 30 tickets (say)

    Then D3=000
    D5=29

    and the amount will be (d5-d3+1)*2

    on this ground you may try this

    Use "isblank" function etc as needed)

    Please Login or Register  to view this content.
    Last edited by mahju; 08-26-2016 at 01:28 PM. Reason: Corrected te formula
    Mark the thread as solved if you are satisfied with the answer.


    In your first post under the thread tools.

    Mahju

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Need help with formula for counting packets of scratch tickets

    Quote Originally Posted by gepullen View Post
    Tickets start with 000 and go to 099 on this pack.

    D3 will the the last number recorded from the day before so in this case that number would be 95. D5 will be the current day end in which I sold 3 so the number would be 003.
    Your numbers don't add up the same as your description. If you sold 3, then surely the number would be 002, not 003. (000,001 and 002 = 3 tickets).

    See if this works.

    =IF(D3>D5,100-D3+D5,D5-D3)*2

  5. #5
    Registered User
    Join Date
    08-26-2016
    Location
    Colorado Spring, CO
    MS-Off Ver
    MS Office 2013
    Posts
    2

    Re: Need help with formula for counting packets of scratch tickets

    Quote Originally Posted by jason.b75 View Post
    Your numbers don't add up the same as your description. If you sold 3, then surely the number would be 002, not 003. (000,001 and 002 = 3 tickets).

    See if this works.

    =IF(D3>D5,100-D3+D5,D5-D3)*2
    It works great. I guess with all the string functions I was making the formula more complicated than it needed to be.

+ 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. Best way to learn VBA from scratch
    By SubwAy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-14-2015, 02:27 PM
  2. Need help building DDB from scratch
    By Summers15 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 05-03-2015, 02:13 PM
  3. Take avrg of cells in packets of different sizes based on adjacent cell values
    By thepinkgeologist in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-04-2015, 02:51 PM
  4. Average value for packets having same number
    By madhu11023 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-12-2014, 02:29 PM
  5. [SOLVED] Formula to calculate number of tickets.
    By bandera in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 10-23-2013, 01:45 PM
  6. counting tickets in categories
    By Bob2003 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-01-2012, 01:49 AM
  7. Counting of tickets that have certain criteria
    By Nicki King in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-20-2006, 06:00 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