SmartQueryTools

Cast Column Types in Excel Files Online

Change column data types in Excel files directly in your browser. Cast text to numbers, dates to timestamps, or any supported type conversion — no upload required.

How to cast Column Types in Excel files

  1. Drop your file. Every column is listed with its current type, and each one starts at Keep original.
  2. For each column you want to change, pick a target type: VARCHAR, INTEGER, BIGINT, FLOAT, DOUBLE, BOOLEAN, DATE or TIMESTAMP.
  3. Click Apply Casts. The button stays disabled until at least one column has a new type.
  4. Check the preview for new empty cells. A value that cannot be converted becomes NULL instead of stopping the run.
  5. Download the result in the same format. Column names and order stay the same.

Your file is processed locally in your browser and is never uploaded. The free limit is 50 MB per file; larger files work if your device has the memory for them.

Worked example

A property portal's listing feed arrives with loose types. Prices include "POA" (price on application), bathrooms were written as decimals, and the garage flag is free text. An analyst needs clean numbers and a true/false column before building a price model.

Input (Excel)

Excel workbook, first sheet (Sheet1)

listing_idpricebathroomshas_garage
L-33014850001yes
L-3302POA2no
L-33036125001.5Y
L-33043490002.75n/a

Settings

  • listing_id: Keep original
  • price: INTEGER
  • bathrooms: INTEGER
  • has_garage: BOOLEAN

Result

listing_idpricebathroomshas_garage
L-33014850001true
L-3302NULL2false
L-33036125002true
L-33043490003NULL

"POA" is not a number, so that price becomes NULL. Casting a decimal to INTEGER rounds to the nearest whole number, so 1.5 becomes 2 and 2.75 becomes 3. That loses real information here, and DOUBLE would be the better choice for bathrooms. The BOOLEAN cast understands yes, no and Y, but "n/a" becomes NULL.

Working with Excel files

For most cells, the current types come from the text each cell displays on the first sheet, not from Excel's own number formats. A column formatted as currency or with thousands separators shows as VARCHAR, because values like $1,200.00 are loaded as text. Casting that column to DOUBLE does not help. The $ sign and the comma stop the text being read as a number, so every value becomes NULL. Remove them first with Find and Replace, or set the cells to General in Excel before saving.

Date formats are the exception. A cell with any Excel date format loads as DATE or TIMESTAMP, whatever style it shows, so it rarely needs a cast. Dates typed as text are another matter. Text like 1-Jun-26 stays VARCHAR, and a DATE cast cannot read it, so use Parse Dates. A date column left in General format arrives as serial numbers such as 46083. Give it a date format in Excel before saving. The download is a new workbook. Numbers and booleans are written as real Excel numbers and TRUE/FALSE values. DATE and TIMESTAMP columns are written as text such as 2026-09-14, so Excel formulas will not treat them as dates until you convert them.

Frequently Asked Questions

Why does casting my Excel price column to DOUBLE give empty cells?

Currency and thousands formatting are loaded as text, such as "$1,200.00". The cast cannot read the symbol or the comma, so the result is NULL. Strip them with Find and Replace, or format the cells as plain numbers in Excel, then cast.

Are cast dates saved as real Excel dates?

No. They are written as text like 2026-09-14. Excel can convert them with DATEVALUE or Text to Columns.

What happens to values that do not fit the new type?

They become NULL. Every changed column is converted with TRY_CAST, so one bad value never stops the run. It also fails silently. Compare null counts before and after, for example with the Validate structure tool, to see how many values were lost.

Does casting a decimal to INTEGER round or truncate?

It rounds to the nearest whole number, so 2.75 becomes 3 and 1.25 becomes 1. Exact halves may round to the even neighbour, so do not rely on how 2.5 is handled. Values above 2,147,483,647 become NULL. Use BIGINT for large IDs.

Which text values become true or false with BOOLEAN?

true, false, t, f, yes, no, y, n, 1 and 0, in any letter case. Anything else, such as "on", "open" or "n/a", becomes NULL.

Related Tools