Fill values based on a starting value in one cell with the number in another cell (macro?)

muhleebbin

Active Member
Joined
Sep 30, 2017
Messages
252
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
  5. 2010
Platform
  1. Windows
  2. MacOS
  3. Mobile
  4. Web
Hey all,

I deal with a lot of ticket rolls in my industry and was wondering if there's a way to simplify counting the number of tickets used for a venue.

On sheet 1 i'd like to have column a be a starting value of ticket #, column b the number of tickets in the roll (i.e. 1000 or 20000) and column c be the venue. On sheet 2, i'd like column a to be filled with row 1 the starting value and all rows filled with the series of numbers up until the value of column b in sheet 1. Column b (in sheet 2) to be filled with 1 - (value of column b sheet 1), and column c filled with the venue.

Sheet 3 eventually is my lookup tool for starting number vs ending number using vlookups to find the number of tickets used for a particular venue on a particular day.

example below

sheet 1:
1000012000xyz
700011000abc
1250012000123

<tbody>
</tbody>

sheet 2:
Row NumberTicket NumberTicket Number 2Venue
11000011xyz
20001020002000xyz
2001700011abc
3000710001000abc
300112500011123
500012700002000123

<tbody>
</tbody>


Any other suggestions on how to tackle this would be much appreciated as well. Thanks in advance
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
You don't seem to need sheet 2, a lookup formula can return the ticket numbers from sheet 1 for a given venue.
 
Upvote 0
Can you elaborate?

How would i input a number and that it knows that it is part of a series of valid tickets? i'm trying to make this as dummy proof as possible as well. For instance what if someone inputs the number 174056, then it would come back as it wasn't found within the sequence of ticket numbers.
 
Upvote 0
Something like:


Excel 2010
ABC
21000012000xyz
3700011000abc
41250012000123
5
6
7174056#VALUE!
Sheet5
Cell Formulas
RangeFormula
B7=INDEX($C$2:$C$4,SUMPRODUCT(--($A$2:$A$4<=A7),--($A$2:$A$4+$B$2:$B$4>=A7),ROW($A$2:$A$4)-1))
 
Upvote 0
Thank you very much! That was a lot more simpler than my original convoluted thought!
 
Upvote 0
Blasted! Ran a test on existing tickets, can you help me solve an issue where one set of tickets overlap another?

For example if row 5 was 126001 1000 xyz
 
Upvote 0
Are there many such exceptions? If not, you're better off putting it at the end with a new number and a note of the original.
 
Upvote 0
We use anywhere from 6 - 10 different types of tickets for events and already ran into an overlap within the first 10 rolls. I’d imagine it’ll happen on occasion, at least enough to ask the question.
 
Upvote 0
This any better?


Excel 2010
ABC
21000012000xyz
3700011000abc
41250012000123
51260011000jkl
6
7126002123jkl
Sheet5
Cell Formulas
RangeFormula
B7{=INDEX($C$1:$C$5,SMALL(IF($A$2:$A$5<=$A7,IF(($A$2:$A$5+$B$2:$B$5)>=$A7,ROW($A$2:$A$5))),COLUMN(A1)))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Solution
This worked, however it can't distinguish on its own whether it was a jkl ticket or 123 ticket. Would adding a fourth column help in this instance?

ABCD
A1000012000xyz
B700011000abc
C1250012000123
A1260012000xyz

<tbody>
</tbody>

For the same venue I haven't run into an issue of overlapping ticket numbers as we get rolls usually in sequence. The overlap happens across venues so I added column A for ticket type that I think could help solve this problem? :confused:

Can it index first by column A then B?
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,871
Members
449,055
Latest member
excelhelp12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top