Friday, December 4, 2026

Axyra Sheets TemplateMarkers for Formatted Order Rows

A variable-length order list creates two problems in an Excel template: new rows lose the sample row’s formatting, and the total row gets overwritten. This affects businesses that generate quotes, order reports, invoices, or inventory sheets from Java data using Axyra Sheets.

The most robust approach is to use Axyra Sheets template markers. The template row becomes a repeatable pattern, so each order receives the same borders and number formats while the total row moves below the generated records.

The problem

This issue came up in the Stack Overflow community when a workbook built with io.keikai:axyra-sheets, version 1.0.0-Beta, was populated from a Java list of order objects. The source question and its code examples are available in the original Stack Overflow discussion about repeating a formatted row.

The workbook contains:

  • A header row with Product, Quantity, and Price.
  • One formatted sample row.
  • A total row with a SUM formula.
  • A list whose number of records changes on each run.

Sheet.importData writes values into existing cells. It does not create enough rows or automatically copy the sample row’s borders and number formats. As a result, the second record can overwrite the total row, while later records appear without the original formatting.

The solution

Use Axyra Sheets’ built-in TemplateMarkers mechanism instead of treating the sample row as a fixed destination.

First, change the sample data row in the Excel template to use markers:

ProductQuantityPrice
${orders.product}${orders.quantity}${orders.price}
Total${orders.price:sum}

Keep the desired borders, currency format, alignment, and other visual settings on the marker row.

The orders name connects the markers to the list passed from Java. The product, quantity, and price parts refer to fields on each order object. The :sum instruction tells Axyra Sheets to aggregate the price values for the total.

Then process the worksheet:

import io.keikai.axyra.sheets.template.TemplateMarkers;

try (Workbook wb = Workbook.open(Path.of("order-template.xlsx"))) {
TemplateMarkers.process(
wb.sheet("Orders"),
Map.of("orders", orders)
);

wb.recalculate();
wb.save(Path.of("orders.xlsx"));

}

For three records, Axyra Sheets repeats the marker row three times. It preserves the row formatting, moves the total row down, and fills the generated rows with the corresponding object values.

This approach also avoids relying on a fixed formula such as =SUM(C2:C2). That formula only covers one data row. ${orders.price:sum} is tied to the repeated list, so the total continues to match the number of records.

A manual alternative is possible when the workbook layout requires more control. Insert n - 1 rows below the sample row, copy the sample row’s style to each new row, import the data, and then rewrite the total formula for the expanded range. However, the template-marker approach is simpler for an existing report template with a changing number of orders.

How to apply it

  1. Open the existing order-template.xlsx file in Excel.
  2. Keep the header row unchanged.
  3. Replace the sample values in the data row with these markers:
    • Product: ${orders.product}
    • Quantity: ${orders.quantity}
    • Price: ${orders.price}
  4. Preserve the formatting on that row. Apply borders to all required cells and set the Price cell to the desired currency format.
  5. Replace the fixed total formula with ${orders.price:sum} in the total cell.
  6. Make sure the Java list uses fields that match the marker names. For the example, each object needs product, quantity, and price values.
  7. Open the workbook and call TemplateMarkers.process() on the Orders sheet.
  8. Pass the list through Map.of("orders", orders). The map key must match the orders prefix used in the template markers.
  9. Call wb.recalculate() before saving so the generated total is calculated in the output workbook.
  10. Save the result to a new file, such as orders.xlsx, rather than overwriting the original template.
  11. Test the process with zero, one, and several orders. Pay special attention to the total row, currency formatting, and the position of any content below the order table.

If template markers are not suitable for a particular workbook, use the manual sequence instead: insert rows, copy the sample row’s style, import the records, and update the total formula. Confirm the exact method names in the Axyra Sheets version being used, because APIs such as row insertion and style copying can vary.

Implementation angle

This pattern can become a reliable report-generation service for quotes, sales orders, or inventory movements. An automation partner could connect a form, CRM, or database to Java code that validates each record, fills the Axyra Sheets template, and stores the finished workbook in the correct client folder. The same workflow could then send the report through Make or n8n, while Claude checks formulas and flags missing prices before the file reaches the customer.

Book an AI implementation engagement with Creator Scripts at creatorscripts.com to turn this Excel report process into a dependable business workflow, and browse the Creator Scripts resource library for more guides.

Frequently asked questions

How do I repeat a formatted Excel row for each Java list item?

Use Axyra Sheets template markers in the sample row, such as ${orders.product} and ${orders.price}. Call TemplateMarkers.process() with the list under the matching orders key.

How can I stop new Excel rows from overwriting the total row?

Use a repeatable marker row so Axyra Sheets can add a row for each record and move the total below them. Set the total cell to ${orders.price:sum} to sum the list’s prices.

How do I keep borders and number formats when generating Excel rows?

Apply the borders, alignment, and number formats to the marker row in the template. Axyra Sheets repeats that row’s formatting for the generated records.

Thursday, December 3, 2026

Excel Copilot Updates for Copilot in Excel

Excel Copilot Updates for Copilot in Excel

Excel is expanding in two directions: new functions that let businesses model products and other business objects as single values, and broader Copilot capabilities for data preparation, analysis, workflow automation, and reporting. The changes are aimed at teams that manage inventory, quotes, finance, and operational reports in workbooks, with new entity and dot functions rolling out to Insiders and several Copilot features moving to Insiders or general availability, as Microsoft explains in its official Excel announcement.

What changed

Microsoft announced the updates during the Microsoft Excel World Championship. The release combines new Excel functions with improvements to Copilot in Excel.

The first major change is a new way to represent business objects. Today, a product often occupies several columns, with separate lookup tables for its supplier, category, price, or other details. Entity functions can turn that product into one value that carries its related information. A coffee catalog, for example, could treat Harvest Decaf as one entity containing its supplier, region, altitude, and certification.

Dot functions show the actions available for that value. In Microsoft’s example, a gift box stores its coffees in one field, called an array, which is a collection of values. Typing a dot after the box lets the user choose an operation such as .SetFields() to add Harvest Decaf. Entity, dot, and nine other new functions are rolling out to Insiders.

Copilot in Excel is also becoming more connected to business data:

  • Fabric IQ, available in Insiders, can answer questions about revenue, margin, or variance using governed Power BI semantic models. A semantic model is a controlled definition of business data and metrics.
  • Copilot can create a live PivotTable connected to Fabric, using the definitions approved by the organization and reflecting refreshed data.
  • For data outside Microsoft 365, users can reference sources in a prompt or mention supported partner plugins.
  • The get data capability can create a Power Query based on a description of the needed data and its format. Power Query is Excel’s data-import and transformation system.
  • Clean data can identify inconsistencies such as mixed currencies or uneven rounding, then suggest corrections.
  • Work IQ adds organizational context so Copilot can work with more than raw numbers.

Microsoft also announced change history for collaborative workbooks. Users can ask Copilot what changed, when it changed, who made the change, and how it affected the workbook. They can review human and AI edits and undo selected changes without discarding unrelated work.

For complex processes, Copilot is gaining pre-built skills for accounting, finance, and capital markets. These skills can support financial analysis, account reconciliation, and three-statement models, which connect the income statement, balance sheet, and cash flow statement.

Personalization lets users set preferences for formatting, organization, and analysis. Skill recorder can observe a repeated process and save it as a reusable skill. Skill builder lets users describe a process in natural language and create a custom skill through chat.

Finally, interactive canvas can turn workbook analysis into a connected presentation with key takeaways, charts, sliders, and filters. Because the canvas remains connected to the workbook, the visuals can update when the numbers change.

Why it matters for your business

The entity model could reduce the number of fragile lookup formulas in product, inventory, and customer workbooks. Instead of storing a product’s details across unrelated tables, a single product value can carry the information used in calculations.

That does not remove the need for clean source data. It changes how the workbook uses that data after it has been organized. For a distributor in Mexico, the same product record could hold supplier information, certification, region, and other attributes used in quotes or purchasing reports.

Copilot’s data features address a common operational problem: numbers live in several places. Sales may be in one workbook, purchases in an accounting system, and margins in Power BI. A live PivotTable connected to a governed model can reduce manual copying and make reports more consistent.

Clean data is useful when teams combine information from different sources. Mixed currencies, inconsistent rounding, and other small errors can distort margins and inventory values. Suggested fixes can help an operator identify problems before building a report.

Change history also matters when several people edit the same file. A manager can review what changed instead of comparing multiple copies named “final,” “final 2,” and “final updated.” The ability to undo a specific edit lowers the risk of losing valid work while correcting an accidental change.

The workflow features are most valuable for recurring tasks. Monthly reconciliation, sales analysis, and management reporting often follow the same sequence. Saving that sequence as a skill can reduce repeated instructions, but the result still needs review and proper internal controls before it affects accounting or customer-facing decisions.

How to use it

  1. Choose one recurring workbook process. Start with a task such as preparing a monthly sales report, checking inventory movements, or reconciling payments.
  2. List the data sources. Record where each input comes from, including Excel files, accounting exports, Power BI models, or external systems. Note the currency, date format, and column names used by each source.
  3. Test the data preparation step. Describe the required data to Copilot and ask it to build the Power Query. Review the query output before using it in a report.
  4. Clean the imported data. Use clean data to look for mixed currencies, inconsistent rounding, and other inconsistencies. Confirm each suggested correction against the original source.
  5. Create a controlled analysis. Ask Copilot for a PivotTable based on the approved data or Power BI semantic model. Check the definitions of revenue, margin, and variance before sharing the result.
  6. Try entity functions on a small catalog. Select products with several related attributes, such as supplier, region, certification, and category. Test whether storing each product as one value reduces duplicate lookups.
  7. Use dot functions for repeated changes. Apply .SetFields() to update or extend an entity, such as adding a coffee to a gift box or changing a product attribute. Keep a copy of the workbook while testing Insider features.
  8. Record the approved workflow. Use skill recorder to demonstrate the process once, or use skill builder to describe the steps. Include rules such as the reporting period, currency, rounding, and required checks.
  9. Review the result and change history. Ask Copilot what changed and inspect both human and AI edits. Undo only the changes that are incorrect.
  10. Publish the result with interactive canvas. Use charts, filters, sliders, and key takeaways for managers who need decisions rather than raw worksheet detail.

Implementation angle

A practical implementation can begin with a controlled Excel workbook for products, suppliers, and sales, then connect it to Power Query, Power BI, or an external system through Make or n8n. An automation partner can map currency and rounding rules, test entity-based product records, and create a reusable Copilot skill for monthly reporting. The same process can later move into Zoho Creator when the workbook becomes difficult to control across multiple users.

Book an AI implementation engagement with Creator Scripts at creatorscripts.com to turn this Excel workflow into a reliable operating system for your business.

Frequently asked questions

What are Excel entity functions?

Entity functions let you represent a business object, such as a product, as one value with related information. This can help organize details like supplier, category, and certification without handling each as a separate lookup.

Can Copilot in Excel create a PivotTable from Power BI data?

Copilot can create a live PivotTable connected to Fabric and use definitions from an approved Power BI semantic model. Check that the model’s measures, such as revenue and margin, match your reporting rules.

How can I use Copilot to clean data in Excel?

Copilot’s clean data capability can identify issues such as mixed currencies or inconsistent rounding and suggest corrections. Check suggestions against the source data before using the cleaned information in reports.

Wednesday, December 2, 2026

Excel 2021 Checkboxes: LinkedCell VBA Fix for Filters

A filtered range can show several names, but a form control checkbox still affects the cell to which it is linked. When multiple checkboxes share one linked cell, changing one checkbox changes the same underlying value for every visible row. This affects Excel 2021 workbooks that use checkboxes to mark people as present or not present.

The problem

This issue came up in the Stack Overflow community. A worksheet contains about 200 names, with one form control checkbox on each row. Filtering the names, such as searching for “mike,” works correctly. The problem appears when one visible checkbox is selected and several filtered rows change at the same time. The likely cause is that the checkboxes are not linked to separate cells. See the original Stack Overflow question about Excel 2021 filter ranges with checkboxes.

The Move and size with cells setting controls where a checkbox moves when rows or columns change. It does not determine which cell stores the checkbox value. That job belongs to the checkbox’s LinkedCell property.

Each checkbox should have its own linked cell. For example, the checkbox on the row for Ana should write TRUE or FALSE to Ana’s row, while the checkbox on the row for Mike should write to Mike’s row. If every checkbox points to the same cell, all of them display or change the same result.

The solution

Remove the filter first, then assign each checkbox to the cell underneath it. The VBA routine below loops through the form control checkboxes on the active worksheet and sets each checkbox’s LinkedCell to the address of the cell at its top-left corner.

Sub TieCheckboxesToUnderlyingCell()

    Dim cb As CheckBox

    For Each cb In ActiveSheet.CheckBoxes
        cb.LinkedCell = cb.TopLeftCell.Address
    Next cb

End Sub

Sub starts a VBA procedure. Dim cb As CheckBox creates a variable for one form control checkbox. For Each processes every checkbox on the active sheet. cb.TopLeftCell.Address finds the worksheet cell beneath the checkbox’s upper-left corner. Assigning that address to cb.LinkedCell gives the checkbox its own storage cell.

The checkboxes must be positioned consistently. If each checkbox sits over the cell intended to store its value, the routine creates the correct links. If a checkbox is offset from its row, the code links it to the wrong cell, so check the layout before running it.

This approach uses Excel form controls, not ActiveX controls. An ActiveX textbox and its TextBox_Change event do not solve an incorrect checkbox-to-cell relationship. The filter only hides rows. It does not repair shared links.

How to apply it

  1. Save a backup copy of the workbook before changing the controls.

  2. Clear the filter so every name and checkbox is visible. This makes it easier to verify the layout and ensures the routine processes the full worksheet.

  3. Confirm that each form control checkbox sits over the cell that should hold its status. A common setup places the checkbox in a column named Present, beside the person’s name.

  4. Press Alt+F11 to open the Visual Basic Editor.

  5. Choose Insert, then Module.

  6. Paste the TieCheckboxesToUnderlyingCell procedure into the module.

  7. Return to Excel and run the macro from Developer, Macros, or by pressing F5 inside the VBA editor.

  8. Test several rows before applying a filter. Select one checkbox and confirm that only its linked cell changes.

  9. Apply the filter to the names column. Search for a value such as mike, then select one visible checkbox.

  10. Check the linked cells. Only the selected row should change to TRUE or FALSE. The other filtered rows should keep their own values.

  11. Hide the linked-value column if the worksheet needs a cleaner appearance. Do not delete it, because each checkbox needs a separate cell to store its state.

  12. If the result is still incorrect, right-click one checkbox, open Format Control, and inspect its cell link. Repeat this for a few rows to confirm that the links point to different cells.

A structured table can make the worksheet easier to manage. Keep the name and presence fields in columns, use one row per person, and keep the checkbox status in a dedicated column. Filtering then changes which rows are visible, while each row retains its own independent status.

For a larger operation, a plain status column may be more reliable than dozens of floating controls. Users can select Present or Not present from a drop-down list, and formulas or automation can work directly with the stored text. Checkboxes are convenient for small attendance lists, but they add objects that must remain aligned with the worksheet.

Implementation angle

This fix creates a clean data layer for attendance, customer visits, stock checks, or delivery confirmations. An automation partner could use the linked status cells as the source for a Make or n8n workflow, then send only rows marked TRUE to a CRM, database, or daily report. For a growing process, the same table can move into Zoho Creator, with Excel retained for exports and analysis.

Book an AI implementation engagement with Creator Scripts at creatorscripts.com to make this checkbox workflow reliable and ready for automation.

Frequently asked questions

Why do multiple Excel checkboxes change when I select one?

They may share the same linked cell. Each form control checkbox needs its own linked cell so it can store its own TRUE or FALSE value.

How do I link each checkbox to its own row in Excel?

Assign each checkbox’s LinkedCell to the cell beneath its top-left corner. A VBA macro can do this for every form control checkbox on the active worksheet, provided the controls are positioned over the intended cells.

Will filtering rows affect checkbox links in Excel?

Filtering hides rows but does not change a checkbox’s linked cell. Clear the filter before checking that each checkbox is aligned with its intended cell and linked separately.

Tuesday, December 1, 2026

Open CSV with VBA Using Workbooks.OpenText

A CSV file can open correctly when you double-click it but load into one column when a VBA macro uses Workbooks.Open. The cause is usually a locale mismatch: Excel uses Windows regional settings for an interactive import, while VBA may interpret the file with different defaults.

The problem

This issue affects businesses that receive CSV exports from banks, point-of-sale systems, inventory tools, or accounting software. A file using semicolons, such as col1;col2;col3, may appear correctly split when opened manually but remain in one cell when a macro opens it.

The problem came up in the Stack Overflow community. The original macro also used Shell "explorer.exe" and then assigned ActiveWorkbook, but that approach is unreliable because Windows opens the file asynchronously. The macro can continue before Excel finishes opening the CSV, or it can capture a different workbook as the active one.

CSV means comma-separated values, but the name does not guarantee that commas are the delimiter. A delimiter is the character that separates fields. Depending on the Windows locale and the system that created the file, the delimiter may be a comma, semicolon, tab, or another character.

The solution

Tell Excel the delimiter when opening the file. Do not use Shell, explorer.exe, or ActiveWorkbook to wait for the import.

For a semicolon-delimited file, use Workbooks.OpenText:

Dim wb As Workbook

Workbooks.OpenText _
    Filename:="C:\Data\ventas.csv", _
    DataType:=xlDelimited, _
    Semicolon:=True, _
    Local:=True

Set wb = ActiveWorkbook

DataType:=xlDelimited tells Excel that fields are separated by a delimiter. Semicolon:=True specifies the semicolon. Local:=True tells Excel to use the computer's regional settings for dates and numbers.

This is more reliable than plain Workbooks.Open because the macro explicitly describes the CSV structure. It also avoids depending on how Excel happens to interpret the file on a particular computer.

For a comma-delimited file, change the delimiter option:

Dim wb As Workbook

Workbooks.OpenText _
    Filename:="C:\Data\ventas.csv", _
    DataType:=xlDelimited, _
    Comma:=True, _
    Local:=True

Set wb = ActiveWorkbook

You can specify other options when the file requires them. For example, Tab:=True handles tab-separated data. For a pipe-delimited file, use Other:=True and OtherChar:="|".

Workbooks.OpenText _
    Filename:="C:\Data\ventas.csv", _
    DataType:=xlDelimited, _
    Other:=True, _
    OtherChar:="|", _
    Local:=True

The correct delimiter must match the actual export. Do not select semicolon only because the business operates in a Spanish-speaking country. Windows regional settings often use a semicolon as the list separator when the decimal separator is a comma, but the file itself may still use commas or another format.

How to apply it

  1. Open the CSV file in a text editor, not Excel.

  2. Inspect the first few rows. A line such as A102;Producto;15,50 uses semicolons between fields and commas inside the numeric value.

  3. Confirm the delimiter by looking for the character that appears consistently between columns.

  4. Replace the path with the full file path in the macro.

  5. Use Workbooks.OpenText and set only the delimiter that matches the file.

  6. Store the returned workbook reference immediately after the import. Workbooks.OpenText does not return a workbook object directly, so ActiveWorkbook is acceptable at this point if the macro has not activated another workbook during the import.

  7. Test the macro on a copy of the file. Check dates, decimal values, leading zeros, and product codes before using the result in reports or inventory updates.

  8. Add an explicit worksheet reference before processing the data:

Dim ws As Worksheet
Set ws = wb.Worksheets(1)

MsgBox ws.Cells(1, 1).Value
  1. If the file contains dates or numbers that must follow the source format, review the Local setting. With Local:=True, Excel applies the computer's locale. This can affect decimal separators, date interpretation, and how English month names are recognized.

  2. If the file contains a mixture of delimiters, fix the export process or use Power Query rather than trying to make one VBA import guess the structure. A CSV should use one consistent delimiter throughout.

Regional settings are managed in Windows through the international settings area, commonly reached with intl.cpl. These settings include the list separator, decimal separator, and date format. For example, a computer configured with a comma as the decimal separator often uses a semicolon as the list separator. VBA behavior can differ from what a user sees when opening a file through Excel or Windows, so relying on double-click behavior is risky.

The same issue can also produce incorrect data without obvious errors. A value such as 1,2 may be treated as text, split into separate columns, or interpreted differently from 1.2. Dates such as 3/mar/2026 can also be converted according to the computer's locale. Always validate imported values before the macro continues.

If the delimiter is already known but the file has been opened incorrectly, a fallback is to use Excel's Text to Columns command on the imported column:

With ws.Columns(1)
    .TextToColumns _
        Destination:=.Cells(1, 1), _
        DataType:=xlDelimited, _
        Semicolon:=True
End With

This can repair a simple import, but opening the CSV with the correct delimiter is cleaner. Restructuring the process is better than repeatedly correcting malformed data after import.

Implementation angle

For a recurring sales or inventory workflow, an automation partner can replace the fragile double-click process with a controlled import that detects the expected delimiter, validates the column count, and logs rejected rows. The same process can move the cleaned data into Zoho Creator, trigger a Make or n8n workflow, or generate a quote without relying on ActiveWorkbook. Claude can help document the macro and check formulas, but the delimiter and locale rules still need to be tested against real exports.

Book an AI implementation engagement with Creator Scripts to make your CSV import reliable and connected to the rest of your business process.

Frequently asked questions

Why does my CSV open in one column from an Excel VBA macro?

Excel may be using a different delimiter when VBA opens the file than when you open it manually. The file might use semicolons, tabs, or another character instead of commas. Use Workbooks.OpenText and specify the delimiter used in the file.

How do I open a semicolon-delimited CSV file in VBA?

Use Workbooks.OpenText with DataType:=xlDelimited and Semicolon:=True. Set Local:=True if you want Excel to apply the computer’s regional settings to dates and numbers. Check the imported values before using them in reports or updates.

How can I tell what delimiter a CSV file uses?

Open the file in a text editor and inspect a few rows. Look for the character that consistently separates the fields, such as a comma, semicolon, tab, or pipe. Make sure the VBA import specifies that same character.

Monday, November 30, 2026

Axyra Sheets CellValue: Read Excel Cell Types

A cell iterator needs more than the contents returned by value(). It must distinguish numbers, text, Boolean values, errors, truly blank cells, and arrays. This matters when an operator imports an xlsx workbook and needs reliable totals, inventory records, dates, or empty-field checks.

The problem

This issue came up in the Stack Overflow community while testing an Axyra Sheets workflow that reads each cell in an xlsx workbook. The method sheet.cell(row, column).value() returns a CellValue, but checking only the displayed result does not tell you whether the source cell contains an empty string or no content at all. The original discussion is available in Using Axyra-sheet API to tell data type when reading a cell value.

A second complication affects dates. Excel stores dates as numbers, so a value such as 45291.0 may represent a date or an ordinary amount. The number alone does not provide enough business meaning. The cell's number format determines whether Excel displays that number as a date.

The API also does not use null for an empty cell. A blank cell and a text cell containing "" can both look empty when displayed, but they represent different cell content. That difference affects validation, imports, and decisions such as whether to create a customer record or leave a field untouched.

The solution

Use the CellValue type itself as the source of truth. Axyra Sheets defines six records through its sealed CellValue interface:

  • CellValue.Number, for numeric content
  • CellValue.Text, for text content
  • CellValue.Bool, for Boolean values
  • CellValue.Error, for spreadsheet errors
  • CellValue.Blank, for a cell with no content
  • CellValue.Array, for an array result

A sealed interface is a Java type whose permitted implementations are known. That makes it suitable for a switch statement that handles every supported cell type.

String description = switch (cell.value()) {
    case CellValue.Number n -> "number " + n.value();
    case CellValue.Text t -> "text " + t.value();
    case CellValue.Bool b -> "bool " + b.value();
    case CellValue.Error e -> "error " + e.display();
    case CellValue.Blank b -> "blank";
    case CellValue.Array a -> "array";
};

This example uses pattern matching from Java 21. For older Java versions, use a sequence of instanceof checks and handle each permitted type separately.

The distinction between empty text and a blank cell is especially important:

CellValue value = cell.value();

if (value instanceof CellValue.Blank) {
    // The cell contains no content.
}

if (value instanceof CellValue.Text text && text.value().isEmpty()) {
    // The cell contains text whose value is "".
}

Both cases may return true when checked with isEmpty(). Do not use that check when the business process needs to distinguish an intentionally empty text result from a cell that was never populated.

Use cell.formattedText() only when you need the value as a person sees it. It returns processed, displayed text rather than the raw cell value. For example, a formatted currency amount may be useful in a report, but it is usually the wrong value for calculations or data validation.

For dates, first identify the cell type. If the value is a CellValue.Number, use cell.dateValue() or cell.dateTimeValue() when the cell's number format represents a date or time. These methods return a Java date object when the cell qualifies, and null when it does not. A text value that looks like a date remains text and needs separate parsing rules.

How to apply it

  1. Get the cell object and read its raw value.
Cell cell = sheet.cell(row, column);
CellValue value = cell.value();
  1. Handle the value according to its CellValue record.
if (value instanceof CellValue.Number number) {
    double amount = number.value();
    // Process a numeric value.
} else if (value instanceof CellValue.Text text) {
    String content = text.value();
    // Process text, including an intentional empty string.
} else if (value instanceof CellValue.Bool bool) {
    boolean answer = bool.value();
    // Process TRUE or FALSE.
} else if (value instanceof CellValue.Error error) {
    String message = error.display();
    // Record or reject the spreadsheet error.
} else if (value instanceof CellValue.Blank) {
    // Treat the cell as having no content.
} else if (value instanceof CellValue.Array array) {
    // Handle an array result according to the workbook design.
}
  1. Separate blank cells from empty text before applying required-field rules. For example, a blank product code may mean the row is unused, while an empty text value may come from a formula or an intentional user entry.

  2. Check numeric cells before converting them to dates.

if (value instanceof CellValue.Number) {
    LocalDate date = cell.dateValue();

    if (date != null) {
        // Use the date as a Java LocalDate.
    } else {
        // Treat the number as an amount or another numeric value.
    }
}
  1. Parse text dates separately. A text value such as 15/01/2026 is not automatically the same as an Excel date number. Apply the date format used by the business, and reject ambiguous or invalid text instead of silently converting it.

  2. For a complete worksheet, avoid making one API call for every cell when possible. Use sheet.usedRange() to identify the populated area, then call range.values() to retrieve a CellValue[][] block. This reduces repeated cell queries and gives the iterator a consistent structure to process.

  3. Keep raw values for calculations and validation. Use formattedText() only when generating a display report, exporting a human-readable document, or showing the same presentation seen in Excel.

  4. Add explicit handling for errors and unexpected arrays. A sales import should not quietly convert an error cell into an empty product or amount. Store the row and column location so someone can correct the workbook.

Implementation angle

This type-aware reader can become a dependable import layer for a small business workbook. An automation partner could map Number, Text, Bool, Blank, and Error into structured records in Zoho Creator, while preserving the difference between an empty string and an unfilled field. The same process could use Make or n8n to route invalid rows for review, and use Claude to generate and check Java validation rules before deployment.

Book an AI implementation engagement with Creator Scripts to turn your Axyra workbook iterator into a reliable operational workflow.

Frequently asked questions

How do I check a cell’s data type when reading an Excel file in Java?

Read the cell with cell.value() and check which CellValue type it returns. Handle numbers, text, Boolean values, errors, blanks, and arrays separately.

How can I tell a blank Excel cell from an empty string?

Check whether the value is CellValue.Blank or CellValue.Text with an empty value. Both can look empty, but they represent different cell content.

How do I know whether a number in Excel is a date?

Excel stores dates as numbers, so the number alone is not enough to identify one. Check the cell’s number format and use cell.dateValue() or cell.dateTimeValue(); these methods return null when the cell does not qualify as a date or time.