Zoho Sheet BYCOL Function: Column Totals and Weighted Revenue
Apply LAMBDA by column in Zoho Sheet, with complete spill examples, manual checks, shifted ranges and quantity-weighted revenue calculations.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
BYCOL applies a calculation separately to each input column and returns the column results horizontally. It is useful when columns represent channels, products or measurement series and each needs its own total or maximum.
Availability and version history
- Introduced: Named in the fifteen-function launch linked from Zoho’s March 2023 release history; no numbered cloud release is given.
- Availability: Listed in the current Zoho Sheet function reference; no final supported-version endpoint is documented.
- Scope: Zoho Sheet web-service documentation. Individual mobile, desktop/offline and imported-workbook behavior remains separately unverified.
- Checked: October 14, 2026, against the official BYCOL entry. Outputs were independently calculated; no native Zoho Sheet execution was performed.
Syntax and output direction
BYCOL(array; LAMBDA(column; calculation))
The official BYCOL entry gives SUM and MAX patterns. The parameter represents one column of selected values; it is not the column letter or an index. Its local name can be column, values or another valid name used consistently in the calculation.
Zoho’s helper-function announcement confirms the horizontal result for BYCOL and vertical result for BYROW. These examples reduce each selected column to one number. Other result shapes and argument-count errors are not fully specified by the short entry.
Enter seven days of channel counts
Create ChannelTotals with room through column I and row 13. Enter Channel 1, Channel 2 and Channel 3 in A1:C1, followed by this complete numeric fixture in A2:C8:
| Worksheet row | A: Channel 1 | B: Channel 2 | C: Channel 3 |
|---|---|---|---|
| 2 | 12 | 8 | 10 |
| 3 | 5 | 15 | 10 |
| 4 | 0 | 6 | 9 |
| 5 | 20 | 10 | 5 |
| 6 | 8 | 8 | 8 |
| 7 | 2 | 4 | 6 |
| 8 | 9 | 3 | 12 |
Reserve E2:G2 and E8:G8 as empty result areas. Put headings in E1:G1 and E7:G7. Keep manual checks in rows 4, 6, 10 and 12, away from those areas.
Zoho’s dynamic-array instructions describe entering the formula once in its anchor cell and pressing Enter. Leave its entire result area empty. Do not fill the anchor formula into the other output cells. An obstruction produces the documented #SPILL! error. The separate manual checks below use ordinary fill operations outside those result areas.
Enter:
E2: =BYCOL(A2:C8;LAMBDA(values;SUM(values)))
E8: =BYCOL(A2:C8;LAMBDA(column;MAX(column)))
E4: =SUM(A2:A8)
E6: =E2-E4
E10: =MAX(A2:A8)
E12: =E8-E10
Fill E4, E6, E10 and E12 across through column G. Do not fill E2 or E8.
| Result row | E: Channel 1 | F: Channel 2 | G: Channel 3 |
|---|---|---|---|
| 2 and 4: Totals | 56 | 54 | 60 |
| 6: Total differences | 0 | 0 | 0 |
| 8 and 10: Maxima | 20 | 15 | 12 |
| 12: Maximum differences | 0 | 0 | 0 |
The horizontal position follows the selected source columns. It does not sort the results: Channel 3’s 60 stays in the third position.
In I2 enter =BYCOL(A2:A8;LAMBDA(column;MAX(column))). This matches the single-column pattern in Zoho’s example and gives 20. In I5 enter =MAX(A2:C8), also 20. In I8 enter =MAX(E2:G2), giving 60. The largest individual observation and largest column total answer different questions.
Follow a changed input and an offset range
Duplicate ChannelTotals as ChangedChannel and change B4 from 6 to 16. F2/F4 become 64, and F8/F10 become 16. The other channels keep their original totals and maxima; all six difference checks remain zero. I2/I5 remain 20, while I8 becomes 64.
Create OffsetColumns with room through I10. Copy only the original A1:C8 block from ChannelTotals into C3:E10. Numeric data now occupy C4:E10. Leave G3:I3 empty and enter =BYCOL(C4:E10;LAMBDA(values;SUM(values))) in G3. Enter =SUM(C4:C10) in G5 and fill through I5. Both result rows give 56,54,60. Results are relative to the selected array, not permanently tied to source columns A, B and C.
Keep the input headings outside C4:E10. A returned numeric summary does not reproduce product names unless separate cells supply them.
Advanced: column totals, prices and weighted revenue
Create ProductRevenue, with space through G12. Put Product A, Product B and Product C in A1:C1. Enter the three quantity rows in A2:C4:
| Row | A | B | C |
|---|---|---|---|
| 2 | 2 | 10 | 3 |
| 3 | 8 | 0 | 4 |
| 4 | 5 | 2 | 9 |
Leave A6:C6 empty and enter =BYCOL(A2:C4;LAMBDA(qty;SUM(qty))) in A6. In A7 enter =SUM(A2:A4) and fill through C7. Both rows are 15,12,16. Put unit prices 3,4,2 in A8:C8. Enter A9 =A6*A8, filled through C9: expected revenues are 45,48,32.
Use E2 =SUM(A6:C6), E3 =SUM(A9:C9), E4 =E3/E2, E5 =SUM(A8:C8)/3, E6 =E2*E5 and E7 =E6-E3. Expected outputs are:
| Cell | Interpretation | Expected |
|---|---|---|
| E2 | Total quantity | 43 |
| E3 | Actual modeled revenue | 125 |
| E4 | Quantity-weighted unit price | 125/43 ≈ 2.9069767442 |
| E5 | Equal-weight average of three prices | 3 |
| E6 | Quantity times equal-weight price | 129 |
| E7 | Overstatement from that shortcut | 4 |
Each product’s quantity must stay paired with its own price. Summing first and multiplying by an unweighted price average silently changes the model. SUM combines the column results; BYCOL itself does not know which row contains prices.
Duplicate ProductRevenue as ChangedPrice and change only B8 from 4 to 5. Quantities remain 15,12,16, revenue becomes 45,60,32, and E3 is 137. E4 becomes 137/43 ≈ 3.1860465116; E5 10/3, E6 430/3 ≈ 143.3333333333, and E7 19/3 ≈ 6.3333333333. The quantity summaries remain unchanged while the dependent revenue policy changes.
Errors, related functions and limits
The entry lists #NUM! for arrays that are too large but gives no numeric threshold. Its invalid-name, invalid-type and invalid-reference glossary does not establish every blank, embedded error or malformed-LAMBDA outcome. Keep all selected practice values numeric and check an ordinary column formula first.
BYROW groups by row instead. LAMBDA defines the calculation and its parameters. MAX finds one extreme within each selected column in the maximum example.
The current guide does not establish all mixed-type, nested-array or historical-client behavior. Use the local formula editor’s separators when entering the reference’s semicolon syntax, and keep source data separate from the spill area.