0% found this document useful (0 votes)
7 views

100 Must-Know Functions

Uploaded by

Murali Krishna
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

100 Must-Know Functions

Uploaded by

Murali Krishna
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

100 Must-Know

Functions to Master
Excel, SQL, Python,
R and Power BI

Pooja Pawar

Pooja Pawar
Excel

1. XLOOKUP: Searches a range or array for a match and returns a


corresponding value.
Syntax: =XLOOKUP(lookup_value, lookup_array, return_array,
[if_not_found], [match_mode], [search_mode])

2. VLOOKUP: Searches for a value in the first column of a range and returns
a value in the same row from another column.
Syntax: =VLOOKUP(lookup_value, table_array, col_index_num,
[range_lookup])

3. HLOOKUP: Searches for a value in the first row and returns a value from
the same column in another row.
Syntax: =HLOOKUP(lookup_value, table_array, row_index_num,
[range_lookup])

4. INDEX: Returns the value of a cell in a specified row and column.


Syntax: =INDEX(array, row_num, [column_num])

5. MATCH: Returns the relative position of a value in a range.


Syntax: =MATCH(lookup_value, lookup_array, [match_type])

6. IF: Performs a logical test and returns one value for TRUE and another
for FALSE.
Syntax: =IF(logical_test, value_if_true, value_if_false)

7. IFERROR: Returns a specified value if an error occurs.


Syntax: =IFERROR(value, value_if_error)

SUMIF: Adds the values in a range that meet a specified condition.


Syntax: =SUMIF(range, criteria, [sum_range])

Pooja Pawar
8. COUNTIF: Counts the number of cells that meet a specified condition.
Syntax: =COUNTIF(range, criteria)

9. LEN: Returns the number of characters in a text string.


Syntax: =LEN(text)

10. LEFT: Extracts a specific number of characters from the start of a text
string.
Syntax: =LEFT(text, num_chars)

11. RIGHT: Extracts a specific number of characters from the end of a text
string.
Syntax: =RIGHT(text, num_chars)

12. MID: Extracts text from the middle of a string, starting at a specified
position.
Syntax: =MID(text, start_num, num_chars)

13. TRIM: Removes all extra spaces from text, leaving only single spaces
between words.
Syntax: =TRIM(text)

14. TEXT: Formats numbers and dates into specified text formats.
Syntax: =TEXT(value, format_text)

15. CONCATENATE (or CONCAT): Joins two or more text strings into one.
Syntax: =CONCATENATE(text1, text2, ...)

16. NOW: Returns the current date and time.


Syntax: =NOW()

17. TODAY: Returns the current date without the time.


Syntax: =TODAY()

Pooja Pawar
18. ROUND: Rounds a number to a specified number of digits.
Syntax: =ROUND(number, num_digits)

19. ABS: Returns the absolute value of a number.


Syntax: =ABS(number)

Pooja Pawar
SQL

1. COUNT(): Counts the number of rows that match a specified condition.


Syntax: SELECT COUNT(column_name) FROM table_name;

2. SUM(): Calculates the total sum of a numeric column.


Syntax: SELECT SUM(column_name) FROM table_name;

3. AVG(): Computes the average value of a numeric column.


Syntax: SELECT AVG(column_name) FROM table_name;

4. MIN(): Returns the smallest value in a column.


Syntax: SELECT MIN(column_name) FROM table_name;

5. MAX(): Returns the largest value in a column.


Syntax: SELECT MAX(column_name) FROM table_name;

6. ROUND(): Rounds a numeric value to a specified number of decimals.


Syntax: SELECT ROUND(column_name, decimal_places) FROM
table_name;

7. LENGTH(): Returns the length of a string.


Syntax: SELECT LENGTH(column_name) FROM table_name;

8. UPPER(): Converts a string to uppercase.


Syntax: SELECT UPPER(column_name) FROM table_name;

9. LOWER(): Converts a string to lowercase.


Syntax: SELECT LOWER(column_name) FROM table_name;

10. TRIM(): Removes leading and trailing spaces from a string.


Syntax: SELECT TRIM(column_name) FROM table_name;

Pooja Pawar
11. COALESCE(): Returns the first non-null value in a list.
Syntax: SELECT COALESCE(column1, column2, ...) FROM table_name;

12. CONCAT(): Combines two or more strings into one.


Syntax: SELECT CONCAT(string1, string2) FROM table_name;

13. SUBSTRING(): Extracts a part of a string from a column.


Syntax: SELECT SUBSTRING(column_name, start, length) FROM
table_name;

14. DATEPART(): Extracts a specific part of a date, such as year or month.


Syntax: SELECT DATEPART(part, date_column) FROM table_name;

15. GETDATE(): Returns the current date and time.


Syntax: SELECT GETDATE();

16. CAST(): Converts one data type to another.


Syntax: SELECT CAST(expression AS data_type) FROM table_name;

17. CONVERT(): Converts a value to a specified data type.


Syntax: SELECT CONVERT(data_type, expression, style) FROM
table_name;

18. ISNULL(): Replaces NULL values with a specified value.


Syntax: SELECT ISNULL(column_name, replacement_value) FROM
table_name;

19. DISTINCT: Returns unique values from a column.


Syntax: SELECT DISTINCT(column_name) FROM table_name;

20. GROUP BY: Groups rows sharing a property for aggregate calculations.
Syntax: SELECT column_name, COUNT(*) FROM table_name GROUP BY
column_name;

Pooja Pawar
Python

1. len(): Returns the number of items in an object.


Syntax: len(object)

2. type(): Returns the type of an object.


Syntax: type(object)

3. str(): Converts an object into a string.


Syntax: str(object)

4. int(): Converts a value into an integer.


Syntax: int(value)

5. float(): Converts a value into a floating-point number.


Syntax: float(value)

6. list(): Converts an iterable into a list.


Syntax: list(iterable)

7. dict(): Creates a dictionary from a sequence of key-value pairs.


Syntax: dict([mapping or iterable])

8. set(): Creates a set from an iterable.


Syntax: set(iterable)

9. tuple(): Converts an iterable into a tuple.


Syntax: tuple(iterable)

10. sorted(): Returns a sorted list from an iterable.


Syntax: sorted(iterable, key=None, reverse=False)

11. abs(): Returns the absolute value of a number.


Syntax: abs(number)

Pooja Pawar
12. round(): Rounds a number to a specified number of decimals.
Syntax: round(number, ndigits=None)

13. sum(): Returns the sum of all items in an iterable.


Syntax: sum(iterable, start=0)

14. min(): Returns the smallest value in an iterable.


Syntax: min(iterable)

15. max(): Returns the largest value in an iterable.


Syntax: max(iterable)

16. range(): Generates a sequence of numbers.


Syntax: range(start, stop, step)

17. zip(): Combines multiple iterables element-wise.


Syntax: zip(*iterables)

18. enumerate(): Adds an index to an iterable.


Syntax: enumerate(iterable, start=0)

19. input(): Takes input from the user.


Syntax: input(prompt)

20. print(): Prints objects to the console.


Syntax: print(*objects, sep=' ', end='\n')

Pooja Pawar
R Programming

1. mean(): Calculates the mean of a numeric vector.


Syntax: mean(x, na.rm = FALSE)

2. median(): Calculates the median of a numeric vector.


Syntax: median(x, na.rm = FALSE)

3. sum(): Adds all elements in a vector.


Syntax: sum(x, na.rm = FALSE)

4. min(): Returns the smallest value in a vector.


Syntax: min(x, na.rm = FALSE)

5. max(): Returns the largest value in a vector.


Syntax: max(x, na.rm = FALSE)

6. sd(): Calculates the standard deviation of a numeric vector.


Syntax: sd(x, na.rm = FALSE)

7. var(): Calculates the variance of a numeric vector.


Syntax: var(x, na.rm = FALSE)

8. length(): Returns the number of elements in an object.


Syntax: length(x)

9. abs(): Returns the absolute value of a number.


Syntax: abs(x)

10. round(): Rounds numbers to the specified number of decimal places.


Syntax: round(x, digits)

11. paste(): Concatenates strings with a separator.


Syntax: paste(..., sep = " ")

Pooja Pawar
12. substr(): Extracts or replaces substrings.
Syntax: substr(x, start, stop)

13. grep(): Searches for patterns in strings.


Syntax: grep(pattern, x)

14. sub(): Replaces the first match of a pattern in strings.


Syntax: sub(pattern, replacement, x)

15. gsub(): Replaces all matches of a pattern in strings.


Syntax: gsub(pattern, replacement, x)

16. is.na(): Checks for missing values.


Syntax: is.na(x)

17. apply(): Applies a function to rows or columns of a matrix or array.


Syntax: apply(X, MARGIN, FUN)

18. lapply(): Applies a function to each element of a list.


Syntax: lapply(X, FUN)

19. sapply(): Simplified version of lapply that returns vectors or arrays.


Syntax: sapply(X, FUN)

20. plot(): Creates a graph based on the input data.


Syntax: plot(x, y, ...)

Pooja Pawar
Power BI (DAX)

1. SUM(): Returns the sum of a column.


Syntax: SUM(column)

2. AVERAGE(): Returns the average of a column.


Syntax: AVERAGE(column)

3. COUNT(): Counts the rows in a column.


Syntax: COUNT(column)

4. DISTINCTCOUNT(): Counts the distinct values in a column.


Syntax: DISTINCTCOUNT(column)

5. MIN(): Returns the smallest value in a column.


Syntax: MIN(column)

6. MAX(): Returns the largest value in a column.


Syntax: MAX(column)

7. CALCULATE(): Evaluates an expression in a modified filter context.


Syntax: CALCULATE(expression, filter1, filter2, ...)

8. FILTER(): Returns a table that satisfies a condition.


Syntax: FILTER(table, condition)

9. ALL(): Removes filters from a column or table.


Syntax: ALL(column)

10. RELATED(): Returns a related value from another table.


Syntax: RELATED(column)

11. IF(): Returns one value if a condition is TRUE, and another if FALSE.
Syntax: IF(condition, true_result, false_result)

Pooja Pawar
12. SWITCH(): Evaluates an expression against multiple values.
Syntax: SWITCH(expression, value1, result1, value2, result2, ...,
else_result)

13. ISBLANK(): Checks if a value is blank.


Syntax: ISBLANK(expression)

14. NOW(): Returns the current date and time.


Syntax: NOW()

15. TODAY(): Returns the current date.


Syntax: TODAY()

16. FORMAT(): Formats a value based on a specified format.


Syntax: FORMAT(value, format_string)

17. LOOKUPVALUE(): Returns a single value from a column based on


conditions.
Syntax: LOOKUPVALUE(column, search_column, search_value, ...)

18. DATE(): Creates a date value from year, month, and day.
Syntax: DATE(year, month, day)

19. YEAR(): Extracts the year from a date.


Syntax: YEAR(date)

20. MONTH(): Extracts the month from a date.


Syntax: MONTH(date)

Pooja Pawar

You might also like