Skip to content

Instantly share code, notes, and snippets.

@aya-soft
Last active February 13, 2019 18:42
Show Gist options
  • Select an option

  • Save aya-soft/5099720 to your computer and use it in GitHub Desktop.

Select an option

Save aya-soft/5099720 to your computer and use it in GitHub Desktop.
Spreadsheet: wrong value from formula
#encoding: utf-8
require 'spreadsheet'
xls_file_name = "/tmp/status_data.xls"
xls_book = Spreadsheet.open(xls_file_name, "rb")
xls_book.worksheet(0).each do |row|
puts row[6].value if row[6] and row[6].is_a?(Spreadsheet::Formula)
end
@zdavatz

zdavatz commented Mar 7, 2013

Copy link
Copy Markdown

With above script I get

/tmp> ruby aya.rb
7.5
5.37
7.52
9.78

with your sample XLS (not modified by me) on my Gentoo Linux.

Best
Zeno

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment