🧮 Spreadsheet Functions
Powerful Built-in Calculations
Spreadsheet functions are pre-built formulas that perform specific calculations, making complex data analysis tasks simpler and more efficient. Understanding common functions and how to use them effectively is a key skill in spreadsheet mastery.
📚 Function Basics
🔣 Function Structure
- Functions begin with an equals sign (=)
- Function name followed by parentheses:
=FUNCTION()
- Arguments (inputs) are placed inside parentheses
- Multiple arguments are separated by commas
- Example:
=SUM(A1:A10,B5,C7)
🧙♂️ Using the Function Wizard
- Helps build functions with proper syntax
- Shows available functions by category
- Provides descriptions and examples
- Guides you through entering arguments
📊 Common Mathematical Functions
📈 SUM
- Adds all numbers in the specified range
- Syntax:
=SUM(number1, [number2], ...)
- Examples:
=SUM(A1:A10)
=SUM(A1:A10,C1:C10)
=SUM(5,10,15,B5)
📊 AVERAGE
- Calculates the arithmetic mean of numbers
- Syntax:
=AVERAGE(number1, [number2], ...)
- Examples:
=AVERAGE(B2:B20)
=AVERAGE(10,20,30,A1:A10)
🔢 COUNT
- Counts cells containing numbers in a range
- Syntax:
=COUNT(value1, [value2], ...)
- Examples:
=COUNT(A1:A20)
=COUNT(A1:A20,C5:C15)
📊 MAX and MIN
- Find the largest or smallest value in a range
- Syntax:
=MAX(number1, [number2], ...)
=MIN(number1, [number2], ...)
- Examples:
=MAX(C5:C15)
=MIN(Sales_Data)
🔄 ROUND
- Rounds a number to a specified number of digits
- Syntax:
=ROUND(number, num_digits)
- Examples:
=ROUND(A1,2)
=ROUND(3.14159,3)
=ROUND(2345.6789,-2) // Rounds to nearest hundred: 2300
📅 Date and Time Functions
📆 TODAY and NOW
- TODAY returns the current date
- NOW returns the current date and time
- Syntax:
=TODAY()
=NOW()
- Examples:
=TODAY()+7 // Date one week from today
=NOW()-TIME(2,0,0) // Current time minus 2 hours
📅 DATE
- Creates a date from year, month, and day values
- Syntax:
=DATE(year, month, day)
- Examples:
=DATE(2025,4,15)
=DATE(YEAR(TODAY()),MONTH(TODAY())+3,1) // First day of 3 months from now
⏱️ DATEDIF
- Calculates the difference between two dates
- Syntax:
=DATEDIF(start_date, end_date, unit)
- Examples:
=DATEDIF(A1,B1,"Y") // Years between dates
=DATEDIF(A1,B1,"M") // Months between dates
=DATEDIF(A1,B1,"D") // Days between dates
=DATEDIF(A1,B1,"YM") // Months excluding years
📆 WEEKDAY
- Returns the day of the week as a number
- Syntax:
=WEEKDAY(date, [return_type])
- Examples:
=WEEKDAY(A1) // 1 (Sunday) through 7 (Saturday)
=WEEKDAY(TODAY(),2) // 1 (Monday) through 7 (Sunday)
📝 Text Functions
🔤 CONCATENATE or &
- Joins text strings together
- Syntax:
=CONCATENATE(text1, [text2], ...)
=text1&text2
- Examples:
=A1&" "&B1
=CONCATENATE("Hello, ",A1,"! Today is ",TEXT(TODAY(),"dddd"))
📄 LEFT, RIGHT, and MID
- Extract portions of text strings
- Syntax:
=LEFT(text, num_chars)
=RIGHT(text, num_chars)
=MID(text, start_num, num_chars)
- Examples:
=LEFT(A1,3) // First 3 characters
=RIGHT(A1,4) // Last 4 characters
=MID(A1,3,5) // 5 characters starting from position 3
🔠 UPPER, LOWER, and PROPER
- Change the case of text
- Syntax:
=UPPER(text)
=LOWER(text)
=PROPER(text)
- Examples:
=UPPER(A1) // "hello" becomes "HELLO"
=LOWER(A1) // "HELLO" becomes "hello"
=PROPER(A1) // "hello world" becomes "Hello World"
📏 LEN
- Returns the length of a text string
- Syntax:
=LEN(text)
- Examples:
=LEN(A1)
=LEN("Hello World") // Returns 11
🔍 Lookup and Reference Functions
🔎 VLOOKUP
- Searches for a value in the first column of a table and returns a value from the same row
- Syntax:
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
- Examples:
=VLOOKUP("Smith",A2:D50,3,FALSE)
=VLOOKUP(A1,Products,2,TRUE)
🔍 HLOOKUP
- Similar to VLOOKUP but searches horizontally (in rows)
- Syntax:
=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])
- Examples:
=HLOOKUP("Q1",A1:E5,3,FALSE)
=HLOOKUP(B1,Quarter_Data,2,FALSE)
🎯 INDEX and MATCH
- More flexible alternative to VLOOKUP/HLOOKUP
- Syntax:
=INDEX(array, row_num, [column_num])
=MATCH(lookup_value, lookup_array, [match_type])
- Combined example:
=INDEX(C2:C20, MATCH("Smith", A2:A20, 0))
=INDEX(Sales_Data, MATCH(A1, Customer_IDs, 0), MATCH(B1, Product_Codes, 0))
🧩 Logical Functions
🔀 IF
- Performs a logical test and returns different values based on the result
- Syntax:
=IF(logical_test, value_if_true, value_if_false)
- Examples:
=IF(A1>10,"High","Low")
=IF(A1="Yes",1,0)
=IF(Sales>Target,"Bonus","No Bonus")
🔗 AND and OR
- Combine multiple conditions
- Syntax:
=AND(logical1, [logical2], ...)
=OR(logical1, [logical2], ...)
- Examples:
=IF(AND(A1>10, A1<20), "Medium", "Outside range")
=IF(OR(A1<5, A1>15), "Outside range", "Within range")
=IF(AND(Sales>1000, Profit>100), "Excellent", "Average")
📊 COUNTIF and SUMIF
- Count or sum cells that meet specific criteria
- Syntax:
=COUNTIF(range, criteria)
=SUMIF(range, criteria, [sum_range])
- Examples:
=COUNTIF(A1:A20, ">10")
=COUNTIF(Status, "Completed")
=SUMIF(A1:A20, "Completed", B1:B20)
=SUMIF(Region, "North", Sales)
✅ Best Practices
- Start with simple functions and gradually learn more complex ones
- Use function help and tooltips to understand syntax
- Break complex calculations into multiple steps:
// Instead of this:
=IF(AND(A1>10,B1<5),SUM(C1:C10)/COUNT(C1:C10),"N/A")
// Use this for clarity:
=IF(AND(A1>10,B1<5),AVERAGE(C1:C10),"N/A")
- Test functions with simple data to verify they work as expected
- Document complex functions with cell comments
- Consider using named ranges to make functions more readable:
// Instead of this:
=SUMIF(A1:A100,">1000",B1:B100)
// Use this for clarity:
=SUMIF(Region,"North",Sales)
Mastering spreadsheet functions dramatically increases your productivity and the power of your spreadsheets, enabling sophisticated data analysis and automation of repetitive calculations.