Basic Functions
-
SUM: =SUM(range) Adds up all the values in a range.
-
AVERAGE: =AVERAGE(range) Calculates the mean of a range of values.
-
COUNT: =COUNT(range) Counts the number of numerical values in a range.
-
COUNTA: =COUNTA(range) Counts all non-empty cells in a range.
-
IF: =IF(condition, value_if_true, value_if_false) Checks if a condition is met, returns specified values accordingly.
-
IFERROR: =IFERROR(value, value_if_error) Handles errors by returning a specified value when an error is encountered.
Lookup & Reference Functions
-
VLOOKUP: =VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup]) Looks up a value vertically in a table.
-
HLOOKUP: =HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup]) Looks up a value horizontally in a table.
-
INDEX: =INDEX(array, row_num, [column_num]) Returns a value from a specific position in a range.
-
MATCH: =MATCH(lookup_value, lookup_array, [match_type]) Returns the position of a value in a range.
-
XLOOKUP: =XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode]) A more powerful lookup function that works both horizontally and vertically.
Data Cleaning & Transformation
-
TRIM: =TRIM(text) Removes all extra spaces from a string, except single spaces between words.
-
TEXT: =TEXT(value, format_text) Formats a number as text in a specific format (e.g., dates, numbers).
-
CONCATENATE: =CONCATENATE(text1, text2, …) Joins multiple strings into one.
-
LEFT, RIGHT, MID:
=LEFT(text, num_chars): Extracts the leftmost characters from a string.
=RIGHT(text, num_chars): Extracts the rightmost characters.
=MID(text, start_num, num_chars): Extracts characters from the middle.
- SUBSTITUTE: =SUBSTITUTE(text, old_text, new_text) Replaces existing text with new text within a string.
Date & Time Functions
-
TODAY: =TODAY() Returns the current date.
-
NOW: =NOW() Returns the current date and time.
-
DATE: =DATE(year, month, day) Creates a date from separate year, month, and day inputs.
-
DATEDIF: =DATEDIF(start_date, end_date, unit) Calculates the difference between two dates in years, months, or days.
Statistical Functions
-
MEDIAN: =MEDIAN(range) Returns the median of a range.
-
MODE: =MODE(range) Returns the most frequent value in a range.
-
STDEV: =STDEV(range) Calculates the standard deviation of a range of values.
-
RANK: =RANK(number, ref, [order]) Ranks a number in a list of numbers.
Logical Functions
-
AND: =AND(logical1, logical2, …) Returns TRUE if all conditions are TRUE.
-
OR: =OR(logical1, logical2, …) Returns TRUE if at least one condition is TRUE.
-
NOT: =NOT(logical) Reverses the logical value (TRUE to FALSE, or FALSE to TRUE).
Data Analysis
-
Pivot Tables: Create summaries from large datasets by using Insert > PivotTable. It allows you to aggregate, filter, and analyze data quickly.
-
Conditional Formatting: Use Home > Conditional Formatting to highlight cells based on rules or conditions (e.g., color cells above a certain threshold).
-
Data Validation: Restrict input values using Data > Data Validation to enforce criteria on user input.
-
Text to Columns: Split data into different columns using Data > Text to Columns.
Automation with VBA
-
Macro Recording: Record repetitive tasks using Developer > Record Macro.
-
Basic VBA Functions:
Range(“A1”).Value = 10: Sets the value of cell A1 to 10.
For Each cell in Range(“A1:A10”): Loops through a range of cells.
Charts and Visualization
-
Charts: Create basic visualizations like bar charts, line graphs, and scatter plots using Insert > Charts.
-
Slicers: Use Insert > Slicer to add interactive filters to PivotTables or PivotCharts.
-
Sparklines: Insert mini-charts inside cells with Insert > Sparklines.
Shortcuts
-
Ctrl + Shift + L: Toggle filters on/off.
-
Ctrl + T: Convert a range of data into a table.
-
Ctrl + Shift + Enter: Enter an array formula.
-
Alt + =: Automatically sum selected cells.
-
Ctrl + `: Toggle between displaying formulas and results.
This cheat sheet covers the essentials for data scientists to efficiently manipulate and analyze data in Excel.