Ravindra BagaleCourses & study guides मराठी Track your progress

9. Dynamic Arrays

Excel

9.13 TOCOL and TOROW: Turn a Grid into One List

Turn a worksheet grid into a list with a known order

Salman prepares a fictional Swiggy-inspired rider roster. His worksheet has shift names down the side and day names across the top, convenient for someone filling in the schedule. He needs to count assignments per rider. The input is a grid. The calculation will be easier to inspect if it has one list of names. Excel can create that list without copying cells into it one at a time.

To flatten a grid is to read all its selected cells into one dimension in a specified order. TOCOL returns one column. TOROW returns one row. Traversal order means the sequence in which the input positions are read. A row scan finishes a row before moving down. A column scan finishes a column before moving right.

Set the scan order and decide which inputs to keep

First try a two-by-two amount grid. On a scratch sheet, enter 10 and 20 in A2:B2 and 30 and 40 in A3:B3. Read row one left to right, followed by row two, to obtain 10, 20, 30, 40. Read column A top to bottom, followed by column B, to obtain 10, 30, 20, 40. The same four values are present. Only the order changes. Enter one formula at a time in a free area and predict where the third element appears.

=TOCOL(A2:B3,0,FALSE)
=TOCOL(A2:B3,0,TRUE)
=TOROW(A2:B3,0,FALSE)
=TOROW(A2:B3,0,TRUE)
For rows 10, 20 and 30, 40, scan by row gives 10, 20, 30, 40 while scan by column gives 10, 30, 20, 40.
Choose how to read the source. The output can still be a row or column.
Use the ignore argument to declare how to treat empty input and errors.
ValueWhat to keepUseful check
0 or omittedAll input positionsA genuinely empty referenced cell can show as zero
1Values and errors, skipping blanksA real numeric zero should remain
2Values and blanks, skipping errorsA blank position can still show as zero
3Values, skipping blanks and errorsCount skipped values independently for review

Microsoft documents both functions for Excel 2024, current Microsoft 365 and Excel for the web. Some editions that support the first dynamic arrays do not support these functions. Try the small two-by-two case on the edition that will use the file. Include the correct range and leave room for the full one-dimensional result. A column spill needs free space below its anchor. A row spill needs room on its right.

Lab 1. Count filled rider assignments and compare the scan directions

On a blank tab named Roster, enter the following in A1:D4. Leave the two cells with dashes completely empty. The days are record categories, and the name area is only B2:D4. The shift and day labels identify positions but are not rider values.

Roster A1:D4. Type only the names and headings, and leave the dash locations empty.
ShiftMonTueWed
MorningShahrukhAmirShahrukh
AfternoonZoyaZoya—
Evening—RajaRani
  1. In F1 put Rider, then enter =TOCOL(B2:D4) in F2. Expect nine output positions. The two genuinely empty input cells display as zeros in this result. Both positions are still represented.
  2. Change F2 to =TOCOL(B2:D4,1). Now there are seven names because blank locations are skipped. Read Shahrukh, Amir, Shahrukh, Zoya, Zoya, Raja, Rani. Use a scratch formula =ROWS(F2#) to check seven.
  3. In H2 enter =UNIQUE(F2#). The five riders are Shahrukh, Amir, Zoya, Raja and Rani. Repeated names correspond to separate assignments. UNIQUE adds another operation to the flattening step to give one label per rider.
  4. Put Shifts in I1 and enter =COUNTIF(B2:D4,H2#) in I2. The results beside the five names are 2, 1, 2, 1 and 1. Together they account for all seven filled assignments.
  5. In another area use =TOCOL(B2:D4,1,TRUE). Here the sequence is Shahrukh, Zoya, Amir, Zoya, Raja, Shahrukh, Rani. The counts by rider remain the same. The list starts with all the Monday entries and then uses Tuesday and Wednesday.

Check what changes when you switch output orientation

Enter =TOROW(B2:D4,1) in an empty row with seven free cells. It returns the same sequence as the row-scanned F2 formula horizontally. For this output, COLUMNS tells how many values it contains and ROWS gives one. For the vertical F2 result, ROWS counts the selected values. If you swap the function in a workbook, review any downstream formula using ROWS or COLUMNS.

The original nine slots have three rows of shifts and three columns of days. After flattening, the displayed names do not carry either of those labels. This is fine for a simple count of assignments per person. If a manager asks which worker was assigned on Wednesday evening, refer to the source position or create a record list with the labels beside each name. Changing the scan order does not, by itself, preserve the day and shift labels.

Read the roster in two directions

  1. Choose only name cells

    Pass B2:D4, with nine possible assignments. Exclude labels outside that rectangle.

  2. Read across each shift

    The first three values are Shahrukh, Amir and Shahrukh from the Morning row.

  3. Read down each day

    Switch to column scan with TRUE. Monday starts with Shahrukh and Zoya, then the blank is skipped.

  4. Check the preserved facts

    Each scan finds seven assignments for five distinct people. Only their sequence changes.

Test the effect of filling an empty slot

Type Amir in the empty Wednesday Afternoon cell D3 on a practice copy. The F2 result grows from seven names to eight. The distinct rider count stays five because Amir already appears. Amir's count grows from one to two. Existing assignment labels are not overwritten. This observation checks much more than the list size alone. If it no longer spills, verify there is room below F2 and the counts. Remove the test value before repeating the original fixture.

Lab 2. Rank weekly values while preserving what they describe

Create a Weekly sheet. Enter City, W1, W2, W3 and W4 across A1:E1. Each body value below is a fictional amount measured in thousands of rupees. An entry of 520 means ₹520,000 in this worksheet. Midway through the lab you will add the city and week alongside each value, so keep the labels visible.

Enter this grid in A1:E4 on Weekly. Source units are thousands of rupees.
CityW1W2W3W4
Pune520610580700
Nashik300280350330
Nagpur410390450470

Check a compact numeric list before sorting

  1. In G2 use =TOCOL(B2:E4). Expect twelve values, starting 520, 610, 580, 700. Values in that first group all come from Pune.
  2. Try =TOCOL(B2:E4,0,TRUE) in a new column. It starts with W1 for all cities, 520, 300, 410. After that it reaches W2 values 610, 280, 390. The last group is 700, 330, 470 for W4.
  3. Run =TAKE(SORT(G2#,1,-1),3) in a separate position. You should get 700, 610 and 580. These are three city-week observations, and more than one can come from the same city.
  4. Check =SUM(--(G2#>450)) gives five. The native amount 450 is exactly at the cutoff and is not counted. All four Pune values plus Nagpur's 470 qualify.
  5. Use =AVERAGE(G2#) to get about 449.17 and compare with =AVERAGE(B2:E4). AVERAGE can directly read the original rectangle. Flattening is useful when the next task specifically needs the list or its order.

SUM of the twelve values is 5,390. The numbers are all in the same units, so that control is meaningful. Sorting the list changes no amount and leaves this total intact. It does remove the original order. Now think about a reader who asks which city and week produced 700. A sorted value-only list has dropped both pieces of context.

The largest amount is 700 thousand rupees. Its source coordinates identify Pune and Week W4. A record list keeps both labels next to the value.
The numeric list shows the value. Preserve the row and column keys when another step needs its source identity.

Create one record for each cell including its two labels

For the complete twelve-value fixture, generate a consecutive sequence starting at 0 in the same order as the row-scanned TOCOL. Four weeks occupy each city row. Dividing each index by four gives a row position and a remainder. The whole quotient tells how many complete rows have been read. The remainder gives the next column within that row. Add one to each to use Excel's 1-based positions.

=LET(valueGrid,$B$2:$E$4,
     weekCount,COLUMNS(valueGrid),
     positions,SEQUENCE(ROWS(valueGrid)*weekCount,1,0),
     cityPosition,QUOTIENT(positions,weekCount)+1,
     weekPosition,MOD(positions,weekCount)+1,
     HSTACK(INDEX($A$2:$A$4,cityPosition),
            INDEX(TRANSPOSE($B$1:$E$1),weekPosition),
            TOCOL(valueGrid,0,FALSE)))

Enter the expression in J2 with space for twelve rows and three columns. Give the fields City, Week and Amount (thousand rupees) headings in J1:L1. Check the derived position and amount together. Position 0 becomes city 1 and week 1, Pune W1 520. Position 3 is Pune W4 700. Position 4 starts city 2 and week 1, Nashik W1 300. Position 11 ends with Nagpur W4 470.

In a free area try =TAKE(SORT(J2#,3,-1),3). The top three complete records are Pune W4 700, Pune W2 610 and Pune W3 580. The entire records moved together, so there is no need to guess their labels from the old numeric position. If sorting values and labels independently, a numeric value could sit beside the wrong city without generating an error.

This example keeps every grid position so its label arrays remain aligned. Suppose you now omit missing values from only the amount vector. The first missing cell would shift every later amount relative to the unfiltered label vectors. Apply one consistent keep rule to the combined record array using flags derived in the same scan order. The next section lets you see why a missing observation needs its own flag.

Separate measured zero, a blank slot and a source error

On a scratch tab, put numeric 0, a truly empty cell and numeric 20 in A2:C2. In A3:C3 put the formula =NA(), numeric 30 and a truly empty cell. This makes six source locations. There are three numeric observations, one error and two blank slots. A real zero is one of the three observations. The four ignore settings help demonstrate why a result should identify which values it kept.

Expected row-scan sequences from the scratch A2:C3 grid.
FormulaSequenceNumber of values
=TOCOL(A2:C3,0)0, 0, 20, #N/A, 30, 06
=TOCOL(A2:C3,1)0, 20, #N/A, 304
=TOCOL(A2:C3,2)0, 0, 20, 30, 05
=TOCOL(A2:C3,3)0, 20, 303

Check how a choice changes the average. Ignoring errors while retaining blank positions produces five output values and sum 50, giving average 10. Skipping both errors and blank positions gives three numeric observations of 0, 20 and 30. The sum is still 50, but the average is about 16.67. One calculation treated two missing positions as zeros. Ask which population the report should use before calling either result a measured average.

Independently check =SUM(--ISBLANK(A2:C3)) for two truly blank cells and =SUM(--ISERROR(A2:C3)) for one error. The resulting counts help explain why mode 3 returns only three values. A formula yielding empty text is another source state. If your input has formula-generated placeholders, decide explicitly whether to preserve, classify or skip those. Test it alongside a real empty cell without assuming the displayed cells have the same underlying value.

For an audit keep the full source grid and a note about what each skip setting removes. A consumer can report the usable sample while disclosing missing measurements. A convenient trimmed list does not recover the unseen values. If the report expects all six observations for a certification, use the missing and error counts to stop and investigate rather than relying on a clean-looking list.

Keep one membership rule for complete records

Return to Weekly and keep the J2 formula that creates City, Week and Amount. In a practice copy, clear the amount for Pune W2 in C2, leaving the week title unchanged. The original cell represented the second position in a row scan. A list made using =TOCOL(B2:E4,1) now has eleven amounts. Its second value is 580, from Pune W3. A label vector built from every original position still has Pune W2 in position two. Stacking these independent vectors would make the Pune W2 field look like it contained 580.

Instead, keep the value grid's record positions while making the raw record list, and use a matching source mask for the data policy after the records are assembled. A mask here is one yes-or-no value per record. The following filter accepts only clearly numeric source cells and excludes blank and error positions. The ISNUMBER checks refer to the original grid, so a displayed zero from a materialized blank does not masquerade as an observation.

=FILTER(J2#,TOCOL(ISNUMBER($B$2:$E$4),0,FALSE),"No numeric observations")
  • Verify the missing pair. After clearing C2, the descriptor Pune W2 should disappear. Pune W3 still has the amount 580. The filter removes the complete record carrying the invalid input.
  • Check the number and amount. There are eleven measured rows and total 4,780. This subtracts the original 610 from 5,390. It does not change the amount on a different row.
  • Try a genuine zero. Enter numeric 0 in C2. Its position is included and the row count returns to twelve. The amount total remains 4,780, so the two different source states need the row count to distinguish them.
  • Keep exception evidence. In the blank test, inspect the corresponding source label and mark it missing. In another copy put =NA() in C2 to test an error. The measured-only report excludes that record too. A separate check using ISERROR distinguishes the error test from the blank test.
  • Restore the original fixture. Put the numeric 610 back in C2. The full source shape, total and top-three report should match the original again.

Every independent mask and value list must use the same orientation. If labels were generated in row scan order but the amounts were read by column, the shape and length might still match. The second amount would be Nashik W1 at 300 rather than Pune W2 at 610. The correctness check is whether a known coordinate retains its label and amount, not whether HSTACK succeeded. When changing scan order, change the coordinate calculations together.

Show a known positional pattern before filtering

For a column scan, all city rows for W1 appear first. There are three cities per week. A zero-based position can be divided by three to get the number of complete weeks. Its remainder is the index of the city within this week. That is the opposite assignment from the row-scan expression, which divided by four weeks to locate a city row. Try to name the positions for the first three and last three observations without using any sorting. All three W4 values should be together at the end.

A worksheet team may track the order needed by another process. Specify “row scan, city then week” or “column scan, week then city.” If they later sort by amount, keep the key and amount in the same record. This avoids spreading a sorting choice across separately ordered arrays. Compare with a known ID and its value after a structural change to the source.

Use a one-row result only when it fits the next operation

Another teammate wants one long row of worksheet headings from a little bank of approved labels. For an exact practice block enter Date, City, Qty on the first row of A1:C2, and Amount, Status, Source on the second. Use =TOROW(A1:C2) in E1. The six results begin Date, City, Qty and finish Amount, Status, Source. That output can label a table that already has six fields in that order.

A worksheet with multi-level headings is different. If the first row says Week 1 and Week 2 and the second says Actual and Target under each, reading both rows into a single sequence makes all heading cells separate entries. It does not automatically combine Week 1 and Actual into one field name. Use a documented header construction rule for the columns of the original table. Confirm label count and order match the actual result width before using VSTACK to place labels above records.

Pick the simplest tool for the target output

  • One numeric statistic. AVERAGE, MEDIAN and similar functions can often read a rectangle directly. Flattening first is unnecessary for the unchanged, complete numeric weekly grid if the only deliverable is its average.
  • One list of observed values. TOCOL prepares values for a list-based distinct set or a ranking. Consider whether readers need the original field labels for each entry.
  • One row for a specified output. TOROW can produce approved labels or a horizontal display. Make sure the entire result fits within the intended worksheet area.
  • Many refreshable records with keys. In an import workflow, unpivoting can create a measure name and value per record while retaining identifier columns. That is useful for a changing weekly export. It solves a different need from turning a rectangle into bare values.

Flattening a grid with different units can introduce invalid arithmetic. If one column contains rupees and another contains minutes, both appear as numbers in the flattened result. An average of them has no common unit. Select only a consistently defined measure grid. If you need mixed fields in a report, preserve what each field means as an independent column and aggregate within the right unit.

Practice with a smaller roster

Use a new sheet with Shift, Mon, Tue and Wed in A1:D1. Fill A2:D2 with Morning, Amit, Neha and one empty cell. Fill A3:D3 with Evening, Ravi, one empty cell and Amit. The six slots contain four assigned names. Keep both empty cells blank rather than typing the string Blank.

Return all four assignments in one column

Use =TOCOL(B2:D3,1). The result is Amit, Neha, Ravi, Amit in row scan order. The first two assigned names come from Morning and the final two from Evening.

Count the filled assignments on the schedule

Use =ROWS(TOCOL(B2:D3,1)) for four, because the valid result is one column with one row per kept value. It includes both appearances of Amit. For an all-empty schedule, check source coverage before asking a list to return only assigned names.

Read the schedule one day at a time

Use =TOCOL(B2:D3,1,TRUE). The visible values are Amit, Ravi, Neha, Amit. The first two come from Monday. The last two come from different days, after skipping the blank positions.

Show each distinct rider once

Use =UNIQUE(TOCOL(B2:D3,1)) for Amit, Neha and Ravi. That three-row list describes people. The four-row source of assignments is still needed to count how often each person appears.

Keep the same row-first scan with a horizontal result

Use =TOROW(B2:D3,1). It gives Amit, Neha, Ravi and Amit across one row. COLUMNS of that one-row result is four. The scan starts in the same place even though the direction of the output changed.

Count Amit's assignments before removing duplicates

Use =SUM(--(TOCOL(B2:D3,1)="Amit")). The four comparisons are TRUE, FALSE, FALSE and TRUE. Converting them to ones and zeros and adding gives two. Counting the distinct rider list would only show that Amit belongs to it.

Check the complete weekly list in both shapes

On Weekly, use =TOROW(B2:E4) to show twelve values across one row, grouped by city in the original sequence. Use =TOCOL(B2:E4,0,TRUE) to show twelve values down a column starting with W1 for all three cities. Both have average 449.17 rounded and total 5390.

Review size, scope and assignment labels

Count potential spill positions before using a large input

A fully populated 200-by-100 grid has 20,000 values. Excel's worksheet has 16,384 columns. TOROW would need a longer single row than the sheet allows, even from its first column. A one-column output could fit within the worksheet row limit when placed far enough up and with no blockers. Check source size and actual available destination before choosing the direction. If an operation would exceed the worksheet capacity, summarize or reshape the input in a tool that supports the required size.

Include only the source range that is part of the task. A formula that reads many unused rows may produce unwanted zeros or a very large output before a later formula processes it. A roster with three days and three shifts has nine possible positions. When a fourth day is added, a fixed B2:D4 formula does not see it. Update the source selection deliberately or choose a source structure that represents the growing data, then verify the extra assignments.

Determine which identifiers survive the transformation

A row of a schedule can identify the shift, and its column the day. When flattening value cells, both sets of labels are outside the value rectangle. Include them as new fields if someone needs to identify the assignment later. An explicit unpivot workflow is often useful here. Power Query calls the former column heading an attribute and the former cell content a value. Keeping City alongside those two fields would yield the same basic kind of city, week and amount records as the coordinate lab.

The task should tell you whether there must be a record for each position or only for occupied positions. A coverage audit of the nine roster slots needs all nine positions. Counting assignments needs the seven filled ones. A single report table can keep the empty slots if it includes a separate status field for them. In a trimmed assigned-only report, record the number of missing slots separately. This distinction keeps a person from thinking there were only seven slots to fill.

Proofread labels and per-person counts

A roster may use two names that look alike where one has a trailing space. Test the original identifiers before grouping. A name alone may also be shared by two people. If this data should drive a real assignment report, use a staff ID as the group key and join the display name separately. A same-name collision cannot be solved by changing TOCOL's scan order or making a numeric count of visible names. The fictional lab uses distinct names to isolate the layout behaviour.

Keep a known roster test with a person who occurs twice and a day with an empty slot. The recorded total should equal the sum of counts by rider, and the distinct-person count should be no larger than the filled assignment count. Test both scan directions and check that this reconciliation still holds. If location matters, also trace one named assignment to its day and shift.

Construct the same complete records ordered by week first

On the original Weekly data, make a second complete record view in a different output area from J2. It has the same three fields and twelve records. This time let each week finish all cities before the next week begins. The point of this exercise is to see the formula coordinates and the scan order agree, rather than matching only the final amount total.

=LET(valueGrid,$B$2:$E$4,
     cityCount,ROWS(valueGrid),
     positions,SEQUENCE(cityCount*COLUMNS(valueGrid),1,0),
     cityPosition,MOD(positions,cityCount)+1,
     weekPosition,QUOTIENT(positions,cityCount)+1,
     HSTACK(INDEX($A$2:$A$4,cityPosition),
            INDEX(TRANSPOSE($B$1:$E$1),weekPosition),
            TOCOL(valueGrid,0,TRUE)))
  1. Compare the first three records with column B of the source. They are Pune W1 520, Nashik W1 300 and Nagpur W1 410. One week appears beside all three cities.
  2. Read position three in the zero-based sequence, which is the fourth displayed record. It starts W2 with Pune and 610. A value of 300 beside Pune W2 would reveal a coordinate mismatch.
  3. Read the last three records. They have the three cities and W4 amounts 700, 330 and 470. In the city-first source order, those three values were separated by other weeks.
  4. Compare the records by the pair of City and Week. The total still gives 5,390 and all twelve keys appear in both outputs. Sort the complete records by Amount before comparing the top entries. The highest still belongs to Pune W4.

If you want one group's four weeks while preserving the original labels, filter the three-field records by City instead of taking the first four columns or rows of an arbitrary scan. For the city-first version at J2, try =FILTER(J2#,CHOOSECOLS(J2#,1)="Pune","No matching city"). It returns four complete records, with amounts 520, 610, 580 and 700, totaling 2,410. The same filter applied to the week-first complete view returns those same four Pune observations in week order. Range and label checks are more durable than relying on what is currently at the top of a display.

Practice deciding which problem you are solving. A label-aligned record view can change its order while keeping every assignment. A weekly chart can filter to one source key. A list of values can be appropriate for a distribution chart across all city-weeks, where a single observation has no special label. For a weekly trend by city, the chart needs those fields and the dates behind the week labels. Use the resulting data shape as part of the report definition.

Before using the method in another workbook, repeat the tiny two-by-two exercise and carry row and column labels beside those four values. Predict the second row in both scan orders and compare. That check catches the common error of changing only the TOCOL argument while leaving the two index expressions written for the previous orientation.

Compare two records that happen to have the same amount

In a practice copy, change Nagpur W4 from 470 to 700. Two different observations now tie for the highest amount. A numeric list shows 700 twice. Use =COUNTIF(G2#,700) on the original amount spill anchor in that test copy to verify two numeric observations at the highest amount. An automatic distinct-value list would show it once, even though the two cities each had an observation. In the record view the two keys are Pune W4 and Nagpur W4. With the original layout, =FILTER(J2#,CHOOSECOLS(J2#,3)=700,"No observations of this amount") should give both rows, which the manager can verify separately.

Use that test to decide if the report counts distinct values or counts records. Both are legitimate metrics, but they answer different questions. Check that removing repeated amounts does not combine several measurements simply because they are equal. The weekly group total in the changed copy is 5,620 because 700 replaces 470. Restore 470 before reusing the original exercise totals.

Quiz with explained answers

Does TOCOL need column scan to return a single column?

No. The name TOCOL determines the output shape, which is one column. The scan argument determines which input cell comes next. Try both on 10, 20 and 30, 40. Both results are vertical, but the second value is 20 in row scan and 30 in column scan.

Which choice keeps the zero and drops the empty positions in a complete grid?

Use ignore mode 1 for genuinely empty cells while keeping measured zeros and errors. If the business rule allows removing the errors too, select mode 3 and verify both exclusion counts independently. A real zero is an input value, and does not disappear with the blanks.

How many distinct people and assignments are in the untouched roster?

Five distinct people and seven filled assignments. One person can appear in more than one slot. UNIQUE produces the five names. The seven-value list preserves all of their assignments. Use the fuller list or original grid to measure how many each person has.

What are the first three values with a column scan on the weekly data?

520, 300 and 410. They are W1 for Pune, Nashik and Nagpur. A row scan instead starts 520, 610 and 580, which are Pune values for W1, W2 and W3. Confirm the expected source grouping when selecting a scan direction.

Why is a value of 450 absent from the strict above-450 count?

The comparison is greater than 450. The exact boundary does not pass. Pune provides four qualifying observations and Nagpur 470 supplies the fifth. Changing the comparison to greater than or equal to includes the 450 too, producing six in this fixture.

What information disappears when you flatten just B2:E4?

The result carries the values themselves, without the source City and Week labels. Even if a later sorted list shows 700, the value alone does not identify which city or week supplied it. Preserve those labels beside the amount in a record array before sorting when traceability is needed.

Interview questions you can answer from practice

How do you choose between output direction and scan direction?

The next tool may expect a vertical list, which calls for TOCOL, or a horizontal row, which calls for TOROW. Separately, decide the input traversal the business needs. In the roster, row scan groups by shift and column scan groups by day. I would verify its first three entries against the source.

What would you check before hiding errors in a flattened output?

I would identify where they came from and record their number and locations separately. A smaller result can be correct when only validated observations belong in the measure. It should also disclose missing coverage. A fully required range should be repaired first instead of silently shortened.

Why can the average change when skipping blanks although the sum stays the same?

Missing inputs displayed as zeros contribute no additional amount but add to the number of returned values. In the scratch grid, the two ignore modes give fifty divided by five or fifty divided by three. The denominator is different. A measured zero remains included in both cases.

How would you keep the right labels if the amount grid has blank cells?

Create records for the complete set of positions first. Determine which original numeric cells qualify, then filter each whole record with the same traversal order. Removing blanks only from the amount list would shift later amounts up beside incorrect labels. I would test a deliberately missing second value to expose that shift.

When would you unpivot instead of using TOCOL alone?

If the output must keep a key and the original field name for every observation, unpivoting provides a long record list that carries those labels. For one simple list or a distribution of already comparable values, TOCOL can create that input directly. I would verify units and ensure the result contains the necessary fields.

Revision cards

  • TOCOL is vertical. TOROW is horizontal. Both allow either source travel direction.
  • Set the scan. FALSE reads across each row. TRUE reads down each column.
  • Choose a skip policy. 0 keeps all, 1 skips blanks, 2 skips errors, 3 skips both.
  • Keep real zeros. A zero amount is an observation. A blank need not be one.
  • Preserve source labels. Add city, week, shift or day to each position before sorting complete records.
  • Reconcile coverage. Compare the output count and total with the source, then account for any excluded values.

Microsoft references