計算式のセルはどうなる?
- 選ぶ
- 確かめる
Excelの表に、SUMやVLOOKUPなどの計算式が入っている。CSVやJSONに変換したら、計算式は、どうなるのでしょうか。ExcelをCSV・JSONに変換する の扱いを説明します。
結論
このツールは、ファイルに保存されている計算結果を出力します。計算式そのものは、出力しません。
手順
- 「.xlsx のExcelファイルを1つ選びます」で、ファイルを選びます。
- 「シート」と「形式」を選びます。
- 「変換後」で、計算式のセルが、結果の値になっているか確認します。
計算結果が古い場合
Excelは、ファイルを保存するときに、計算結果も一緒に保存します。他のソフトで作ったファイルや、プログラムで書き出したファイルは、計算結果が保存されておらず、空や0になる場合があります。
- 対処:Excelで開いて、保存し直す。計算が実行されて、最新の結果が保存される。
計算式を残したい場合
CSVやJSONは、値だけを保存する形式です。計算式を残したいなら、Excelの形式(.xlsx)のまま、保管してください。
計算結果の確認
変換後の値が、Excelで見た値と同じか、数か所、確認するのがおすすめです。
- 合計や、平均の値
- 参照した値
- 日付の計算結果
エラーのセル
Excelで、エラー(#N/A、#REF!など)になっているセルは、そのエラーの文字が出力される場合があります。変換前に、直しておきます。
向いている使い方
- 集計済みの表を、データとして取り出す
- 計算結果だけを、他のシステムに渡す
例
合計欄に、SUMの計算式が入った売上表を、CSVに変換した。計算式ではなく、合計の数字が出力された。他のシステムに取り込むのに、ちょうどよかった。
つまずきやすい点
- 値が0や空になる:計算結果が保存されていない。Excelで保存し直す。
- 小数点以下の桁が違う:表示の丸めと、実際の値の違い。
- 他の計算式を残したい:Excel形式のまま保管する。
よくある質問
計算式を文字として出力できますか?
できません。値のみです。
まとめ
計算式は、結果の値で出力される。結果が古いときは、Excelで保存し直しましょう。
ExcelをCSV・JSONに変換するを使う(無料)あわせて使えるツール
- CSVをExcelファイルにする:CSVを、Excelで開ける .xlsx ファイルにします。
- CSVとJSONを相互変換する:CSVとJSONを、すぐに相互変換します。
- Wordから文字を取り出す:Wordファイルの本文を、文字だけで取り出します。
同じツールの、ほかの解説
What Happens to Formula Cells
- Choose
- Check
An Excel table contains formulas such as SUM and VLOOKUP. What happens to the formulas when converted to CSV or JSON? Here is how Convert Excel to CSV or JSON handles them.
Conclusion
This tool outputs the calculation results saved in the file. It doesn't output the formulas themselves.
Steps
- With "Choose one .xlsx Excel file", choose the file.
- Choose the "Sheet" and "Format".
- In "After conversion", check that formula cells are the resulting values.
When results are stale
When Excel saves a file, it saves the calculation results together. Files made in other software or written out by programs may have no saved results and show empty or 0.
- Remedy: open in Excel and re-save. The calculation runs and the latest result is saved.
If you want to keep formulas
CSV and JSON are formats that save values only. If you want to keep formulas, store the file in Excel format (.xlsx).
Checking the results
It is recommended to check a few places to see that the values after conversion match what you see in Excel.
- Totals and averages
- Referenced values
- Results of date calculations
Error cells
Cells showing errors in Excel (#N/A, #REF! and so on) may have the error text output. Fix them before converting.
Uses it suits
- Extracting a tallied table as data
- Handing only the calculation results to another system
Example
Converted a sales table with SUM formulas in the total column to CSV. The total numbers were output instead of the formulas. That was just right for importing into another system.
Common stumbling blocks
- Values are 0 or empty: results weren't saved. Re-save in Excel.
- Decimal places differ: the difference between display rounding and the actual value.
- Want to keep other formulas: store in Excel format.
Frequently asked questions
Can formulas be output as text?
No. Values only.
Summary
Formulas are output as their result values. If results are stale, re-save in Excel.
Use "Convert Excel to CSV or JSON" (free)Tools that go well with this
- Convert CSV to Excel (.xlsx): Convert a CSV to an Excel (.xlsx) file.
- Convert CSV and JSON: Convert between CSV and JSON instantly.
- Extract Text from a Word File: Extract the plain text from a Word file.