Kitchen Sink

Back
A1
A B C D E F G H I J K L M N
1 BASIC ARITHMETIC DATA NAMES FORMATTING CONDITIONALS IMAGES HTTP FETCHING CUSTOM FUNCTIONS
2 2 + 3 * 4 14 7 alice 150 danger low info@rubygrids.app fetch_json (title) delectus aut autem tax(100) 7.7
3 (10 - 2) ** 3 512 14 bob 75 warning low test@example.com fetch_json (userId) 1 grade(95) A
4 100 / 3.0 33.33 21 charlie 30 success odd md5("hello") 5d41402abc4b2a76b9719d911017c592 fetch_json (keys) userId, id, title, completed grade(72) C
5 sqrt(144) 12 28 Info info discount(200, 15) 170
6 35 Note highlight DATE & TIME tax(D2) 0.539
7 CELL REFERENCES 42 Dimmed muted 2026-05-21
8 25 100 49 Strong bold 19:56
9 7 32 56 Slanted italic Thursday
10 132 Cascade! 63 -141
11 Hello 70 DYNAMIC STYLES
12 RANGES + ENUMERABLE 200
13 Sum D2:D11 385 50
14 Avg D2:D11 38.5 99
15 Count > 40 5
16 Max value 70 FORMAT RULES
17 Min value 7 1200 CHF currency
18 Sorted (first 3) 7, 14, 21 3500 CHF currency
19 Count D:D (column) 10 750 CHF currency
20 STRING METHODS ON on/off
21 Upcase E2 ALICE OFF on/off
22 Capitalize E4 Charlie
23 Length of E4 7 EMOJI FORMAT
24 Replace "a"->"@" ch@rlie to_emoji
25 Reverse E2 ecila to_emoji
26 Join names with ", " Alice, Bob, Charlie 🏢 to_emoji
27 🏠 to_emoji
28 HELPERS
29 sum(10,20,30) 60
30 avg(10,20,30) 20
31 min(5,2,8) 2
32 max(5,2,8) 8
33 round(pi, 4) 3.1416
34 abs(-42) 42
35 ceil(3.7) 4
36 floor(3.7) 3
37 pow(2, 10) 1024
38 concat("A"," ","B") Hello World
39 md5("hello") 5d41402abc4b2a76b9719d911017c592
40 .to_image

Formula Reference

Formula Reference

Every cell starting with = is evaluated as a Ruby expression. Plain text and numbers are stored as-is.

Arithmetic

Standard Ruby operators work in formulas:

Operator Example Result
+ - * / =2 + 3 * 4 14
** =(10 - 2) ** 3 512
% =100 % 7 2

Cell References

Reference cells by column letter + row number:

=A1 * 4
=A1 + B1

References cascade: if B1 depends on A1, changing A1 updates B1 automatically.

Cell Ranges

Use Ruby’s .. range syntax to work with multiple cells. The result is a full Enumerable:

=(A1..A10).sum(&:to_f)
=(A1..A10).count { |v| v > 50 }
=(A1..A10).max_by(&:to_f)
=(A1..A10).min_by(&:to_f)
=(A1..A10).sort_by(&:to_f).first(3)
=(A1..A10).select { |v| v > 0 }
=(A1..A10).map { |v| v * 2 }

Column Ranges

Use A:A syntax to reference an entire column (all rows):

=(A:A).sum(&:to_f)
=(B:B).count { |v| v > 0 }
=(A:A).max_by(&:to_f)

Multi-column ranges work too: A:C covers all cells in columns A, B, and C.

String Methods

Call any Ruby string method on cell values:

Method Example Description
.upcase =A1.upcase Uppercase
.downcase =A1.downcase Lowercase
.capitalize =A1.capitalize Capitalize first letter
.reverse =A1.reverse Reverse string
.length =A1.length Character count
.gsub(a, b) =A1.gsub("a", "@") Replace characters
.split(sep) =A1.split(",") Split into array
.strip =A1.strip Remove whitespace
.include?(s) =A1.include?("text") Check if contains
.start_with?(s) =A1.start_with?("http") Check prefix

Helper Functions

Math

Function Description Example
sum(...) Sum of values =sum(1, 2, 3)
avg(...) Average =avg(10, 20, 30)
min(...) Minimum =min(5, 2, 8)
max(...) Maximum =max(5, 2, 8)
round(n, digits) Round to digits =round(3.14159, 2)
sqrt(n) Square root =sqrt(144)
abs(n) Absolute value =abs(-42)
ceil(n) Round up =ceil(3.2)
floor(n) Round down =floor(3.8)
pow(base, exp) Exponentiation =pow(2, 10)
pi Pi constant =round(pi, 4)

All math helpers accept cell references: =sum(A1, A2, A3).

Text

Function Description Example
concat(...) Join values as text =concat(A1, " ", B1)
md5(text) MD5 hex digest =md5("hello")

Images

Call .to_image on any URL string to display it as an image in the cell:

="https://example.com/photo.jpg".to_image

Combine with md5 for gravatar avatars:

=("https://s.gravatar.com/avatar/" + md5(A1) + "?s=80").to_image

Only HTTP and HTTPS URLs are accepted.

HTTP

Function Description Example
fetch_json(url) Fetch and parse JSON =fetch_json("https://api.example.com/data")["key"]
fetch_text(url) Fetch raw text =fetch_text("https://example.com/file.txt")

JSON responses support [], dig, keys, values, and size.

Requests are cached for 5 minutes. Private networks and localhost are blocked.

Date & Time

Date and Time are available in formulas via safe wrappers. Shorthand helpers today and now are also available.

=today.to_s                              # "2025-06-15"
=now.strftime("%H:%M")                   # "14:30"
=today.strftime("%A")                    # "Sunday"
=Date.parse("2025-12-31").to_s           # "2025-12-31"
=Date.civil(2025, 6, 15).to_s           # "2025-06-15"
=(Date.parse("2025-12-31") - today).to_i # days until
=today.year                              # 2025
=today.month                             # 6
=today.monday?                           # true/false
=(Date.parse(A1) - Date.parse(B1)).to_i  # days between two cells

Date arithmetic works naturally: Date.today + 30 returns a date 30 days from now. Date ranges are iterable: (date1..date2).count.

Custom Functions

Define reusable Ruby methods in the Custom Functions panel (f(x) button). Functions are available in any cell formula:

# In the panel:
def tax(amount)
  amount * 0.077
end

def grade(score)
  case score
  when 90.. then "A"
  when 80..89 then "B"
  when 70..79 then "C"
  else "F"
  end
end
# In any cell:
=tax(A1)
=grade(D5)
=tax(discount(B2, 15))

Functions can call other custom functions, use cell references, and access all built-in helpers. Press Cmd+S in the editor to save.

Conditionals

Use Ruby’s ternary operator or case/when:

=A1 > 100 ? "high" : "low"
=A1.to_i.even? ? "even" : "odd"

Style & Format Rules

Rules are managed in the Style & Format panel. Each rule targets a cell or range and can define a style expression, a format expression, or both.

Style Expressions

Return a CSS class name to style the cell:

value > 100 ? "danger" : value > 50 ? "warning" : "success"

Available styles: danger, warning, success, info, highlight, muted, bold, italic.

Format Expressions

Transform how the cell value is displayed without changing the underlying data:

"#{value} CHF"                           # append currency
value.to_i > 0 ? "ON" : "OFF"           # boolean display
"#{value}%"                              # percentage
value > 1000 ? "#{value / 1000.0}k" : value.to_s  # compact numbers

The expression receives value (the cell’s computed value) and can reference other cells and custom functions. The original value is preserved — only the display changes.

Keyboard Shortcuts

Key Action
Arrow keys Navigate cells
Shift + Arrow Extend selection
Enter Edit cell / Confirm
Escape Cancel / Clear selection
Tab / Shift+Tab Move right / left
Delete Clear cell
Ctrl+C Copy
Ctrl+X Cut
Ctrl+V Paste
F1 Show this help