Quick Notes in Excel 365
Quick Notes in Excel 365
MAXIFS
The syntax of the function is:
=MAXIFS(max_range,criteria_range1,criteria1, criteria_range2,criteria2...)
Suppose you need to get the maximum marks from class 3 then the formula will be
=MAXIFS(marks,class,3)
MINIFS
The syntax of the function is:
=MINIFS(min_range,criteria_range1,criteria1, criteria_range2,criteria2...
Suppose you need to get the minimum marks from class 3 then the formula will be
=MINIFS(marks,class,3)
IFS
Syntax of IFS function:
You can have as many combinations of conditions and values you want. There's a limit but you will never
need to reach that limit.
Let us say that you need to give the grades to the students by there marks. For marks more than 80,
grade A, B for more than 60, C for more than 40 and F for less than or equal to 40.
SWITCH
Unlike the IFS function that returns values based on TRUE, FALSE; the SWITCH function return values
based on VALUES returned by the expression.
Expression: This can be any valid expression that returns some values. A cell reference, a formula or
static value.
Value1,result1: The value and result are paired. If the value returned by the expression is value1 then
the result1 will be returned.
[Default or value2,result2]: If you want to return some default value, define it here. Else define the
value2 and result2. It is optional.
For example, if you have a formula that returns the names of animals. Now, depending on the returned
name of the animal you want to return the signature sound of that animal.
FILTER
The syntax of the FILTER function is:
=FILTER(array,include,[if_empty])
Array: This is the array that you want to filter. It can be one dimensional or two dimensional.
Include: It is the filter that you want to put on the Array. Like, colors="red".
[if_empty]: This is optional. Define any text or expression if the filter returns nothing.
The below formula returns all the fruits whose color is red.
SORT
The syntax of the SORT function is:
=SORT(array,[sort_index],[sort_order],[by_col])
[sort_index]: The column number in the two-dimensional array by which you want to sort the range. By
default, it is 1.
[sort_order]: The order by which you want to sort the array. For ascending it is 1 and for descending it is -
1. By default, it is 1.
[by_col]: Set it True(1) if you want to sort a horizontal array. By default it False(0) for Vertical data.
Let's say if you want to sort values in the range A2:A11 ascendingly. then the formula will be.
=SORT(A2:A11)
UNIQUE
The syntax of the UNIQUE function is:
=UNIQUE(array,[by_col],[exactly_once])
Array: The array from which you want to extract unique values:
[by_col]: Set it TRUE(1) if the array is horizontal. By default, it is FALSE for vertical data.
[exactly_once]: set it TRUE(1) if you want to extract values that occur only once in the array. By default,
it is FALSE(0) to extract all unique values.
Let's say I want to get only one instance of each value from range A2:A11, then the formula will be:
=UNIQUE(A2:A11)
TEXTJOIN
Here the TEXTJOIN function works wonder and concatenates the given texts with the given delimiter.
=TEXTJOIN(delimiter, ignore_empty_cells,text1,[text2],...)
Delimiter: This is the delimiter that you want to use a separator among individual texts. It can be a
comma (,), semicolon (;) or anything, even nothing.
Ignore_empty_cells: This is a binary variable. Set it to TRUE if you want to ignore empty cells in ranges,
else set to FALSE to include the empty cells.
Text1: This is the text that you want to join. It can be individual texts, cells or entire ranges.
Let's say I want to concatenate range A2:A11 with a comma, ignoring the blank cells.
=TEXTJOIN(",",1,A2:A11)
XLOOKUP
The XLOOKUP function searches a range of an array , and then returns the items corresponding to the
first match it finds. If no match exists, then XLOOKUP can return the closest (approximate) match. If
omitted , XLOOKUP returns blank cells it finds in Lookup_array
XLO O K UP SYNT AX
=XLOOKUP( lookup_value, Lookup_array, return_array,[if_not_found], [match_mode] ,[search_mode] )
Argument Description
The Value to search for
Lookup_value
* If omitted , XLOOKUP returns blank cells it finds
Required* in Lookup_array.
=FILTER(A4:D12,(D4:D12>40000)+(B4:B12=“F”),””)
in cell T4 to extract all the entries from Figure 1 of people who have income that exceeds 40,000 or are female
* refers to AND
function
+ refers to OR
function
PO W ER Q UERY I N EXCEL
With Power Query (called Get & Transform Data in previous Excel versions), you can import or
connect to external data, and then shape that data, for example remove a column, change a data
type, or merge tables, in ways that meet your needs. Then, you can load your query into Excel to
create charts and reports. Periodically, you can refresh the data to make it up-to-date.
Transform Shape data to meet your needs, while the original source remains unchanged
Combine Integrate data from multiple sources to get a unique view into the data
Load Complete your query and load it into a worksheet or Data Model and periodically refresh
it.
Excel
Data – Get Data – From File
(Open Power Query Editor) Transform
& Combine
Extract Into
LOAD TO
Raw Data
Data Housekeeping in EXCEL 365 Table
Excel
POWER QUERY EDITOR Pivot Table
CSV
Pivot Chart
PDF
Other Connections
CONNECT
You can use Power Query to import to a single data source,
such as an Excel workbook, or to multiple databases, feeds, or
services scattered across the cloud. Data sources include data
from the Web, files, databases, Azure, or even Excel tables in
the current workbook. With Power Query, you can then bring
all those data sources together using your own unique
transformations and combinations to uncover insights you
otherwise wouldn’t have seen.
TRANSFORM
Transforming data means modifying it in some way to meet your data analysis requirements. For
example, you can remove a column, change a data type, or filter rows. Each of these operations
is a data transformation. This process of applying transformations (and combining) to one or
more sets of data is also called shaping data.
Think of it this way. A vase starts as a lump of clay that one shapes into something practical and
beautiful. Data is the same. It needs shaping into a table that is suitable for your needs and that
enables attractive reports and dashboards.
Power Query uses a dedicated window called the Power Query Editor to facilitate and display
data transformations. You can open the Power Query Editor by selecting Launch Query
Editor from the Get Data command in the Get & Transform Data group, but it also opens
when you connect to a data source, create a new query, or load a query.
The Power Query Editor keeps track of everything you do with the data by recording and
labelling each transformation, or step, that you apply to the data. Whether the transformation is a
data connection, a column removal, a merge, or a data type change, you can view and modify
each transformation in the APPLIED STEPS section of the Query Settings pane.
COMBINE
You can combine multiple queries in your Excel workbook by appending or merging them. The
Append and Merge operations are performed on any query with a tabular shape and
are independent of the data sources that the data comes from.
Append An append operation creates a new query that contains all rows from a first query
followed by all rows from a second query. You can perform two types of append operations:
Merge A merge operation creates a new query from two existing queries. This one query
contains all columns from a primary table, with one column serving as a navigation link to a
related table. The related table contains all rows that match each row from a common column
value in the primary table. Furthermore, you can expand or add columns from a related table into
a primary table.
LOAD
There are two main ways to load queries into your workbook:
From the Power Query Editor, you can use the Close and Load commands in
the Close group on the Home tab.
From the Excel Workbook Queries pane (Select Queries & Connections), you can right-
click a query and select Load To.
You can also fine-tune your load options by using the Query Options dialog box
(Select File > Options and settings > Query Options) to select how you want to view your data
and where you want to load the data, either in a worksheet or a Data Model (which is a relational
data source of multiple tables that reside in a workbook).
After going through the guide to connecting your data and selecting the Edit option, you
will be presented with the query editor. This is where any data transformation steps will
be created or edited. There are 6 main area in the editor to become familiar with.
1. The Ribbon – The user interface for the editor is quite similar to Excel and uses
a visual ribbon style command center. It organizes data transformation
commands and other power query options into 5 main tabs.
2. Query List – This area lists all the queries in the current workbook. You can
navigate to any query from this area to begin editing it.
3. Data Preview – This area is where you will see a preview of the data with all the
transformation steps currently applied. You can also access a lot of the
transformation commands here either from the filter icons in the column headings
or with a right click on the column heading.
4. Formula Bar – This is where you can see and edit the M code of the current
transformation step. Each transformation you make on your data is recorded and
appears as a step in the applied steps area.
5. Properties – This is where you can name your query. When you close and load
the query to an Excel table, power query will create a table with the same name
as its source query if the table name isn’t already taken. The query name is also
how the M code will reference this query if we need to query it in another query.
6. Applied Steps – This area is a chronological list of all the transformation steps
that have been applied to the data. You can move through the steps here and
view the changes in the data preview area. You can also delete, modify or
reorder any steps in the query here.
The Home Tab
The Home tab contains all the actions, transformations, and settings that will affect
the whole table.
1. Close – You can access the Close & Load and Close & Load To options from
here. These are also available in the File tab menu.
2. Query – You can refresh the data preview for the current query or all query
connections. You can also open the properties settings and the advanced
editor for the current query and there are options under the Manage button
to delete, duplicate or reference the current query.
3. Manage Columns – You can navigate to specific columns and choose to keep
or remove columns.
4. Reduce Rows – You can manage the rows of data from this section. There are
lots of options to either keep certain rows or remove certain rows. Keep or
remove the top N rows, the bottom N rows, a particular range of rows,
alternating rows, duplicate rows or rows with errors. One option only
available for removing rows is to remove blank rows.
5. Sort – You can sort any column in either ascending or descending order.
Group By – This allows you to group and summarize your data similar to a Group
By in SQL.
Data Type – This allows you to change the data type of any column.
Use First Row as Headers – This allows you to promote the first row of data to
column headings or demote the column headings to a row of data.
Replace Values – This allows you to find and replace any value from a column.
7. Combine – This sections contains all the commands for joining your query to
with other queries. You can merge, append queries or combine files when
working with a from folder query.
8. Parameters – Power Query allows you to create parameters for your queries.
For example when setting up a from folder query, you may want the folder
path to be a parameter as so you can easily change the location. You can
create and manage existing parameters from this section.
9. Data Sources – This section contains the data source settings including
permissions management for any data sources that require passwords to
access.
10. New Query – You can create new queries from new data sources or previously
used data sources from this section.
You might think there is a lot of duplication between these two tabs. For example,
both tabs contain a From Text section with a lot of the same commands. It’s not
really the case, there is a subtle difference!
When you use a command from the Add Column tab that is found in both tabs, it will
create a new column with the transformed data and the original column will stay
intact. Whereas using the equivalent command from the Transform tab will change
the original column and no new column is created.
This is a critical point to be aware of!
The Transform tab sections.
1. Table – This section contains commands that will transform the entire table.
You can group and aggregate your query, promote rows to headers, demote
headers to rows, transpose your data, reverse row order, and count rows.
2. Any Column – This section contains commands that will work on any column
of data regardless of data type. You can change the data type, automatically
detect and change the data type, rename the column heading, find and
replace values, fill values down (or up) a column to replace any blanks or
nulls with the value above it (or below it), pivot or unpivot columns, move
columns to a new location or convert a column to a list.
3. Text Column – This section contains commands for text data. You can split
columns with a delimiter, format the case, trim and clean, merge two or more
columns together, extract text, and parse XML or JSON objects.
4. Number Column – This section contains commands for numerical data. You
can perform various aggregations like sums and averages, perform standard
algebra operations or trigonometry and round numbers up or down.
5. Date & Time Column – This section contains commands for date and time
data. You can extract information from your dates, times and duration data.
6. Structured Column – This section contains commands for working with nested
data structures such as when your column contains tables.
5. Advanced – This will open the advanced query editor which shows the M code
for the query. This is also available from the Home tab.
6. Dependencies – This will open a diagram view of the query dependencies in
the workbook.
In particular, the Query Dependencies view is a useful resource that allows you to see
a visual representation of the data transformation process flow.
But if you are in Excel 2010 or Excel 2013, go to the Internet and search for
Download Power Query. Your Power Query commands will appear on a dedicated
Power Query tab in the Ribbon.
To start, save that workbook to your hard drive. Put it in a predictable place with a
name that you will use for that file every day.
Browse to the workbook. In the Preview pane, click on Sheet1. Instead of clicking
Load, click Edit. You now see the workbook in a slightly different grid—the Power
Query grid.
Now you need to fix all the blank cells in column A. If you were to do this in the Excel
user interface, the unwieldy command sequence is Home, Find & Select, Go To
Special, Blanks, Equals, Up Arrow, Ctrl+Enter.
All of the null values are replaced with the value from above. With Power Query, it
takes three clicks instead of seven.
Next problem: The quarters are going across instead of down. In Excel, you can fix
this with a Multiple Consolidation Range pivot table. This requires 12 steps and 23+
clicks.
In Power Query select the two columns that are not quarters. Open the Unpivot
Columns dropdown on the Transform tab and choose Unpivot Other Columns, as
shown below.
Right-click on the newly created Attribute column and rename it Quarter instead of
Attribute. Twenty-plus clicks in Excel becomes five clicks in Power Query.
Now, to be fair, not every cleaning step is shorter in Power Query than in Excel.
Removing a column still means right-clicking a column and choosing Remove
Column. But to be honest, the story here is not about the time savings on Day 1.
When you are done cleaning the data, click Close & Load as shown below.
Tip
If your data is more than 1,048,576 rows, you can use the Close & Load dropdown to
load the data directly to the Power Pivot Data Model, which can accommodate 995
million rows if you have enough memory installed on the machine.
It is fun to clean data on Day 1. I love doing something new. But when my manager
sees the resulting report and says “Beautiful. Can you do this every day?” I quickly
grow to hate the tedium of cleaning the same data set every day.
So, to demonstrate Day 400 of cleaning the data, I have completely changed the
original file. New products, new customers, smaller numbers, more rows, as shown
below. I save this new version of the file in the same path and with the same
filename as the original file.
If I open the query workbook and click Refresh, in a few seconds, Power Query
reports 92 rows instead of 68 rows.
Cleaning the data on Day 2, Day 3, Day, 4,...Day 400,...Day Infinity now takes two
clicks.
This one example only scratches the surface of Power Query. If you spend two
hours with the book, M is for (Data) Monkey by Ken Puls and Miguel Escobar, you
will learn about other features, such as these:
Combining all Excel or CSV files from a folder into a single Excel grid
Converting a cell with Apple;Banana;Cherry;Dill;Eggplant to five rows in Excel
Doing a VLOOKUP to a lookup workbook as you are bringing data into Power Query
Making a single query into a function that can be applied to every row in Excel
Sometimes when you are building a query with a lot of steps, you end up going down the
wrong path. If you’re able to pin point at which step your query started going wrong, then
you can delete that step and all steps after to start over (without fully starting over).
In the Applied Steps window pane, right click on the first step you want to delete and
then select Delete Until End from the menu. This will delete that step and all query
steps after that step.
A column in your query might contain table objects. If this is the case, the column’s row
entries will display the text Table and the data type icon.
You can either preview the table or navigate to it in the query depending on where you
click in the cell.
If you click on the blank area of a cell containing a table object, then you will be shown a
preview of the table below your query.
When you hover the mouse cursor over the word Table in the cell, it will change to a
pointing hand icon. When you click on this part the query, it will add a navigation step to
the query which navigates to that particular table.
This will open the External Data Properties menu and you can check the Include row
numbers option and press the Ok button.
Now the next time you refresh the query loaded to your table, a new column
called _RowNum will appear as the left most column and will contain an index for the
row number starting at 0.
If you find most of the queries you end up creating need to be a connection only or need
to load into the data model, then you can change the default load settings. Go to
the Data tab then choose Get Data then open the Query Options.
In the Global Data Load settings, choose the Specify custom default load
settings option and then select or deselect the desired options.
Unchecking both the Load to worksheet box and the Load to Data Model box
will result in your queries loading as connection only and will not load the data
into the data model.
Checking the Load to worksheet box and unchecking the Load to Data
Model box will load queries into an Excel table and not load data to the data
model. Note this is the same as when Use standard load settings is selected.
Unchecking the Load to worksheet box and checking the Load to Data
Model box will result in your queries loading as connection only and will load the
data into the data model.
Checking both the Load to worksheet box and the Load to Data Model box will
load queries into an Excel table and will load the data into the data model.
It can sometimes be hard to tell if each item in a column of data has the same character
length. Not all characters have the same width when using the default query editor font.
This can make it hard to tell if you will be able to split a field by character length
consistently for the entire column.
Change the font to a monospaced character set by going to the View tab and checking
the Monospaced option. This will make it easy to see if things line up in character count.
You can select a column by clicking on its column heading. The column will turn to a
light green colour when selected and you will then be able to perform various
transformations on it by either right clicking on the column heading or using any of the
transformation commands from the ribbon.
If you filter out the item Keyboard from your data and later it shows up as keyboard in
the source data, then your query won’t filter out the lower case version.
This can be avoided by
transforming a column to upper
case before applying any filters.
Now we can apply any filter on the uppercase version of the column and then delete the
column after. This allows us to apply a case insensitive filter without altering the case in
our data.
You’re probably going to be renaming a lot of columns during your power query career
so you’re going to want to learn the quickest way to do it. A double left click on the
column heading will allow you to quickly change a column’s name.
You can rename a column using a keyboard shortcut. This one is a bit slower, but worth
knowing for those that prefer the keyboard to the mouse. With the column selected,
press F2 on the keyboard and you can rename the column heading.
If you need to reuse a power query from a previous workbook, you can easily copy and
paste it from the old workbook to the new workbook.
In the Queries & Connections window of the old workbook, select the queries you want
to copy then right click and choose Copy from the menu. Now navigate to the new
workbook and right click in the Queries & Connections window and choose Paste from
the menu.
This will copy all the selected queries along with all the queries they reference.
If any of the copied queries, or the queries they depend on, reference a table in the old
workbook then those queries will show a Download did not complete error message.
You will need to copy over those tables into the new workbook separately to fix this.
Double Click To Rename A Query
You can quickly rename any query from the query list pane on the left hand side of the
query editor. Double left click on the query which you want to rename, then type in the
new name and press Enter to confirm the change.
If you find the ribbon in the power query editor is getting in the way, you can hide.
Double left click on any of the ribbon tabs to hide the ribbon. Double left click on the tab
again to show the ribbon.
Yep, this is the same trick from the regular workbook ribbon but it can also be used in
the power query editor!
This is another tip that can potentially speed up your power query queries.
When you load data into the data model from power query, Excel will try to find and build
relationships between the new data and other tables in the data model. This extra
processing step will slow down your queries.
If you are always loading your data into the data model then you might want to turn this
feature off to save time. Go to the Data tab then press the Get Data button and open
the Query Options.
In the data preview area, you can select columns with a few different methods. A
column will be highlighted in a light green colour when it’s selected.
You can then apply any relevant data transformation steps on selected columns
from the ribbon or certain steps can be accessed with a right click on the column
heading. Commands that are not available to your
selected column or columns will appear grayed
out in the ribbon.
You can choose from decimal numbers, currency, whole numbers, percentages,
date and time, dates, times, timezone, duration, text, Boolean, and binary.
Using the Locale option allows you to set the data type format using the convention
from different locations. For example, if you wanted to display the date in the
American m/d/yyyy format instead of the usual dd/mm/yyyy then you could select
United States as the locale.
There’s a small table icon in the top left hand corner of the data preview, you
can right click or left click this to access various actions that affect the whole table.
Renaming any column heading is really easy. Double left click on any column heading
then type your new name and press Enter when you’re done.
You can change around the order of any of the columns with a left
click and drag action. The green border between two columns will become the new
location of the dragged column when you release the left click.
Each column also has a filter toggle on right hand side. Left click on this to sort and
filter your data. This filter menu is very similar to the filters found in a regular
spreadsheet and will work the same way.
The list of items shown is based on a sample of the data so may not contain all
available items in the data. You can load more by clicking on the Load more text in
blue.
Many transformations found in the ribbon menu are also accessible from the data
preview area using a right click on the column heading. Some of the action you
select from this right click menu will replace the current column. If you want to
create a new column based, use a command from the Add Column tab instead.
The File tab contains various options for saving any changes made to your queries
as well as power query options and settings.
Close & Load – This will save your queries and load your current query into an
Excel table in the workbook.
Close & Load To – This will open the Import Data menu with various data
loading options to choose from.
Discard & Close – This will discard any changes you made to the queries
during your session in the editor and close the editor.
Note, you will still need to save the workbook in the regular way to keep any changes
to queries if you close the workbook.
Close & Load and Close & Load To commands are also available from the Home tab.
Data Loading Options
When you use the Close & Load To option to exit the editor, this will open the Import
Data menu.
You can choose to load the query to a table, pivot table, pivot chart or only create a
connection for the query. The connection only option will mean there is no data
output to the workbook, but you can still use this query in other queries. This is a
good option if the query is an intermediate step in a data transformation process.
You’ll also be able to select the location to load to in your workbook if you selected
either a table, pivot table or pivot chart in the previous section. You can choose a
cell in an existing worksheet or load it to a new sheet that Excel will create for you
automatically.
The other option you get is the Add this data to the Data Model. This will allow you to
use the data output in Power Pivot and use other Data Model functionality like
building relationships between tables. The Data Model Excel’s new efficient way of
storing and using large amounts of data.
Function Description
DATE(<year>, <month>, Returns the specified date in datetime format.
<day>)
DATEVALUE(date_text) Converts a date in the form of text to a date in datetime format
DAY(<date>) Returns the day of the month, a number from 1 to 31.
Returns the date that is the indicated number of months before or after the start date. Use
EDATE(<start_date>,
EDATE to calculate maturity dates or due dates that fall on the same day of the month as
<months>)
the date of issue
EOMONTH(<start_date>, Returns the date in datetime format of the last day of the month, before or after a specified
<months>) number of months. Use EOMONTH to calculate maturity dates or due dates that fall on the
last day of the month.
HOUR(<datetime>) Returns the hour as a number from 0 (12:00 A.M.) to 23 (11:00 P.M.).
MINUTE(<datetime>) Returns the minute as a number from 0 to 59, given a date and time value.
MONTH(<datetime>) Returns the month as a number from 1 (January) to 12 (December).
NOW() Returns the current date and time in datetime format.
SECOND(<time>) Returns the seconds of a time value, as a number from 0 to 59
TIME(hour, minute, second) Converts hours, minutes, and seconds given as numbers to a time in datetime format.
TIMEVALUE(time_text) Converts a time in text format to a time in datetime format.
TODAY() Returns the current date.
WEEKDAY(<date>, Returns a number from 1 to 7 identifying the day of the week of a date. By default the day
<return_type>) ranges from 1 (Sunday) to 7 (Saturday).
Returns the week number for the given date
and year according to the specified
convention. The week number
WEEKNUM(<date>, <return_type>) indicates where the week falls
numerically within a year.
YEAR(<date>) Returns the year of a date as a four digit integer in the range 1900-9999.
Calculates the fraction of the year represented by the number of whole days between two
YEARFRAC(<start_date>, dates. Use the YEARFRAC worksheet function to identify the proportion of a whole year's
<end_date>, <basis>) benefits or obligations to assign to a specific term.
Function Description
ALL(<table_or_column>) Returns all the rows in a table, or all the values in a column, ignoring any filters that
might have been applied.
ALLEXCEPT(<table>,column1> Overrides all context filters in the table except filters that have been applied to the
,<column2>,…) specified columns.
BLANK() Returns a blank.
CALCULATE(<expression> Evaluates an expression in a context that is modified by the specified filters.
Information functions
Function Description
ISBLANK(<value>) Checks whether a value is blank, and returns TRUE or FALSE.
ISERROR(<value>) Checks whether a value is an error, and returns TRUE or FALSE.
ISLOGICAL(<value>) Checks whether a value is a logical value, (TRUE or FALSE), and returns TRUE or FALSE.
ISNONTEXT(<value>) Checks whether a value is not text (blank cells are not text), and returns TRUE or FALSE.
,<filter1> ,<filter2>…)
CALCULATETABLE(
<expression> , <filter1>, Evaluates a table expression in a context modified by filters.
<filter2>,…)
DISTINCT(<column>) Returns a one-column table that contains the distinct values from the specified column.
EARLIER(<column>, Returns the current value of the specified column in an outer evaluation pass of the
<number>) mentioned column.
EARLIEST(<table_or_column> Returns the current value of the specified column in an outer evaluation pass of the
) mentioned column
FILTER(<table>,<filter>) Returns a table that represents a subset of another table or expression.
RELATED(<column>) Returns a related value from another table
Follows an existing relationship, in either direction, and returns a table that contains all
RELATEDTABLE(<table>) matching rows from the specified table.
Returns a one-column table that contains the distinct values from the specified column.
VALUES(<column>) This function is similar to DISTINCT function, but VALUES function can also return
Unknown member
Returns all the rows, except for blank rows, in a table or column, and disregards any
ALLNONBLANKROW(?) context filters that might exist.
FIRSTNONBLANK(<column>
,<expression>) Returns the first non-blank values in column, filtered by expression.
Logical functions
Function Description
AND(<logical1>,<logical2>,…) Checks whether all arguments are TRUE, and returns TRUE if all arguments are TRUE.
FALSE() Returns the logical value FALSE.
IF(logical_test>,<value_if_true>, Checks if a condition provided as the first argument is met. Returns one value if the
value_if_false) condition is TRUE, and returns another value if the condition is FALSE.
IFERROR(value, value_if_error) Returns value_if_error if the first expression is an error and the value of the expression
itself if otherwise.
NOT(<logical>) Changes FALSE to TRUE, or TRUE to FALSE.
TRUE() Returns the logical value TRUE.
Checks whether one of the arguments is TRUE to return TRUE. The function returns
OR(<logical1>,<logical2>,…) FALSE if all arguments are FALSE
Function Description
ABS(<number>) Returns the absolute value of a number.
CEILING(<number> ,
<significance>) Rounds a number up, to the nearest integer or to the nearest multiple of significance.
ROUNDUP(<number>,
<num_digits>) Rounds a number up, away from 0 (zero).
Function Description
AVERAGE(<column>) Returns the average (arithmetic mean) of all the numbers in a column.
AVERAGEA(<column>) Returns the average (arithmetic mean) of the values in a column. Handles text and non-numeric
values.
AVERAGEX(<table>,
<expression>) Calculates the average (arithmetic mean) of a set of expressions evaluated over a table
COUNT(<column>) The COUNT function counts the number of cells in a column that contain numbers.
COUNTA(<column>) The COUNTA function counts the number of cells in a column that are not empty.
COUNTAX(<table>, The COUNTAX function counts nonblank results when evaluating the result of an
<expression>) expression over a table.
COUNTBLANK(<column>) Counts the number of blank cells in a column.
The COUNTROWS function counts the number of rows in the specified table, or in a table
COUNTROWS(<table>) defined by an expression.
COUNTX(<table>, Counts the number of rows that contain a number or an expression that evaluates to a
<expression>) number, when evaluating an expression over a table.
MAX(<column>) Returns the largest numeric value in a column.
MAXA(<column>) Returns the largest value in a column. Logical values and blanks are counted.
MAXX(<table>, Evaluates an expression for each row of a table and returns the largest numeric value.
<expression>)
MIN(<column>) Returns the smallest numeric value in a column. Ignores logical values and text.
MINA(<column>) Returns the smallest value in a column, including any logical values and numbers
represented as text.
MINX(<table>, < Returns the smallest numeric value that results from evaluating an expression for each row
expression>) of a table.
SUM(<column>) Adds all the numbers in a column.
SUMX(<table>, Returns the sum of an expression evaluated for each row in a table.
<expression>)
Text Functions
FIND(<find_text, within_text, Returns the starting position of one text string within another text string. FIND is case-
start_num) sensitive.
FIXED(<number>, Rounds a number to the specified number of decimals and returns the result as text. You
<decimals>, <no_commas>) can specify that the result be returned with or without commas.
LEFT(<text>, <num_chars>) Returns the specified number of characters from the start of a text string.
LEN(<text>) Returns the number of characters in a text string.
LOWER(<text>) Converts all letters in a text string to lowercase.
MID(<text>, <start_num>, Returns a string of characters from the middle of a text string, given a starting position
<num_chars>) and length.
REPLACE(<old_text>,
<start_num>, <num_chars>, REPLACE replaces part of a text string, based on the number of characters you specify,
<new_text>) with a different text string.
REPT(<text>, <num_times>) Repeats text a given number of times. Use REPT to fill a cell with a number of instances
of a text string
RIGHT(<text>, RIGHT returns the last character or characters in a text string, based on the number of
<num_chars>) characters you specify.
SEARCH(<search_text>, Returns the number of the character at which a specific character or text string is first
found, reading left to <within_text>, [start_num]) right. Search is case-sensitive.
SUBSTITUTE(<text>,
<old_text>, <new_text>, Replaces existing text with new text in a text string.
<instance_num>)
TRIM(<text>) Removes all spaces from text except for single spaces between words.
UPPER (<text>) Converts a text string to all uppercase letters
VALUE(<text>) Converts a text string that represents a number to a number.
FORMAT(<value>,
<format_string>) Converts a value to text according to the specified format.
Time Intelligence Functions
Function Description
CLOSINGBALANCEMONTH(<expression> , Evaluates the specified expression at the calendar end of the given month.
<dates> ,<filter>) The given month is calculated as the month of the latest date in the dates
argument, after applying all filters.
CLOSINGBALANCEQUARTER(<expression> Evaluates the specified expression at the calendar end of the given quarter.
, <dates> , <filter>) The given quarter is calculated as the quarter of the latest date in the dates
argument, after applying all filters.
CLOSINGBALANCEYEAR(<expression> , Evaluates the specified expression at the calendar end of the given year. The
given year is <dates> , <filter>) calculated as the year of the latest date in the dates argument, after applying all filters.
DATESINPERIOD(<date_column> Returns a table of dates that can be found in the specified date column
,<start_date> ,<number_of_intervals> , beginning with the start date and continuing for the specified number of
<intervals>) intervals.
DATESBETWEEN(<column> , <start_date> , Returns a table of dates that can be found in the specified date column
<end_date> beginning with the start date and ending with the end date.
DATEADD(<date_column> , Returns a table that contains a column of dates, shifted either forward in
<number_of_intervals> , <interval>) time or back in time from the dates in the specified date column.
FIRSTDATE (<datecolumn>) Returns the first date in the current context for the specified Date_Column.
LASTDATE (<datecolumn>) Returns the last date in the current context for the specified Date_Column.
LASTNONBLANKDATE (<datecolumn> ,
[<expression>]) Returns the last date in the current context for the specified Date_Column.
STARTOFMONTH (<date_column>) Returns the first day of the month in the specified date column.
STARTOFQUARTER (<date_column>) Returns the first day of the quarter in the specified date column.
STARTOFYEAR(<date_column>[,<YE_date>]) Returns the first day of the year in the specified date column.
ENDOFMONTH(<date_column>) Returns the last day of the month in the specified date column.
ENDOFQUARTER(<date_column>) Returns the last day of the quarter in the specified date column.
ENDOFYEAR(<date_column>) Returns the last day of the year in the specified date column.
PARALLELPERIOD(<date_column> , This function moves the specified number of intervals and then returns all
contiguous full months
<number_of_intervals> ,<intervals>) which contain any values after that shift. Gaps between the first and last
dates are filled in, and months are also filled in.
PREVIOUSDAY(<date_column>) Returns the previous day date from date_column.
PREVIOUSMONTH(<date_column>) Returns the set of dates in the previous month from date_column.
PREVIOUSQUARTER(<date_column>) Returns the set of dates in the previous quarter from date_column.
PREVIOUSYEAR(<date_column>) Returns the set of dates in the previous year from date_column.
NEXTDAY(<date_column>) Returns the next day date from date_column.
NEXTMONTH(<date_column>) Returns the set of dates in the next month from date_column.
NEXTQUARTER (<date_column>) Returns the set of dates for the next quarter from date_column
NEXTYEAR(<date_column>[,<YE_date>]) Returns the set of dates for the next year from date_column.
Returns the subset of dates, from date_column, for the interval that starts at
DATESMTD(<date_column>) the first day of the month and ends at the latest date in the specified dates
column for the month that is the corresponding month of the latest date.
Returns the subset of dates, from date_column, for the interval that
starts at the first day of the
DATESQTD (<date_column>) quarter and ends at the latest date in the specified dates column for the quarter that is the
corresponding quarter of the latest date.
Returns the subset of dates, from date_column, for the interval that starts
DATESYTD (<date_column> [,<YE_date>]) the first day of the year and ends at the latest date in the specified dates
column for the quarter that is the corresponding quarter of the latest date.
SAMEPERIODLASTYEAR() - ? ?
Evaluates the specified expression at the calendar end of the month prior
OPENINGBALANCEMONTH(<expression> , the given month. The given month is calculated as the month of the latest
<dates> , <filter>) date in the dates argument, after applying all filters.
OPENINGBALANCEQUARTER(<expression Evaluates the specified expression at the calendar end of the quarter prior to
> the given quarter. The given quarter is calculated as the quarter of the latest
, <dates> , <filter>) date in the dates argument, after applying all filters.
OPENINGBALANCEYEAR(<expression> , Evaluates the specified expression at the calendar end of the year prior to
<dates> , <filter>) the given year. The given year is calculated as the year of the latest date in
the dates argument, after applying all filters.
Evaluates the specified expression for the interval that starts at the first day
TotalMTD(<expression>,<dates>,<filter>) of the month and ends at the latest date in the specified dates column, after
applying all filters.
Evaluates the specified expression for the interval that starts at the first day
TotalQTD(<expression>,<dates>,<filter>) of the quarter and ends at the latest date in the specified dates column, after
applying all filters.
Evaluates the specified expression for the interval that starts at the first day
TotalYTD(<expression>,<dates>,<filter>) of the year and ends at the latest date in the specified dates column, after
applying all filters.