VLOOKUP example
The version of the browser you are using is no longer supported. Please upgrade to a supported browser.Dismiss

ABCDEFGHIJKLMNOPQRS
1
Demonstration of how to expand a quantity into a similar number of rows.
2
Change any of the "quantity" fields (in pale blue) and observe the result in the lower section. (You'll probably need to make your own copy of the spreadsheet first.)
3
For example, if you specify 0 ponies and three lollipops, you will get three lollipop rows (and no ponies).
4
5
How it works:
6
The "indexing" column is the cumulative sum of the items so far. We use the indexing field as the search
7
term for a VLOOKUP in the results section. (Note that in a real example, INDEXING could be a hidden column.)
8
9
10
INPUT
11
QUANTITYINDEXINGITEMSKU
12
20ponya123
13
22lollipopa332
14
34rainbowa654
15
27fairya874
16
09greatb234
17
19kindb52
18
210generousb622
19
total:12
20
21
RESULTS
22
ITEMDESCRIPTIONSKU
23
1ponya123
24
2ponya123
25
3lollipopa332
26
4lollipopa332
27
5rainbowa654
28
6rainbowa654
29
7rainbowa654
30
8fairya874
31
9fairya874
32
10kindb52
33
11generousb622
34
12generousb622
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100