One of the problems with Excel’s Data Validation is that it is possible to have an invalid entry in a data validation cell. This can be caused by Paste Special Values or linked drop downs that don’t update if an earlier drop down is changed. To easily identify invalid cells you can use a macro.
The UNIQUE function has a bit of an issue with blank cells, formulas that return blank cells and zeroes.
If you need a logical test to determine if a list is unique you can use the MODE function with the ISNA function.
One reason I like the N function is because it is Excel’s shortest function name. But it has quite a few useful features as well.
This is the recording of the second free Power Query webinar I ran in 2022.
You can watch the first one at this link.
In this session we see how to import multiple files in one Power Query. We look at importing CSV and Excel files.
You can download the materials, including a detailed pdf manual using the button below.
If we have a simple Profit and Loss and we want to figure out a breakeven point, we can use Goal Seek to find it.
We can also use it to see sales required to meet a certain profit.
All in less than in minute.
Let’s say we need to do some testing and we need 1,000 random dates in 2022.
We can use a new function to make this easy to create and easy to change.
RANDARRAY usually works with numbers but in Excel dates are numbers, so we get it to create random dates for us.
I set myself a challenge to do this in less than minute – see how I went in the video below.
Earlier this month I ran a free webinar on Excel Power Query.
This is the recording of the session with no editing, no time limit and no sign up required.
Power Query is the best way to import data into Excel. It is also the data importation system used in Power BI, so everything you learn in Excel can be applied to Power BI.
You can download the materials, including a detailed pdf manual at the button below.
Please enjoy, learn and share.
I wrote an article years ago explaining how to use a related table to handle financial years in Excel Pivot Tables. You can read the article here. If you only want the months in financial year order you can just add an extra column to your table.
In general, you should reduce the number of columns you import via Power Query to the minimum you require. Here is a quick technique to make that a bit easier.
Excel has a Remove Duplicates option in the Data ribbon. It keeps the first item and removes any further items that match.
Data types are an important part of Power Query in Excel and Power BI. They define the type of data that should be in a column. When performing some calculations, getting the column data type right is vital.
In my previous blog post I showed a technique to reduce clutter. The technique used a manual formatting method. Here is the automated version.
You can see my previous post here.
Below is the original table.
We can use a Conditional Format to only display the first entry of each date in the Date column.
Select the range A2:A11.
Click the Conditional Formatting drop down and select New Rule (third from the bottom).
Select the last option in the top section “Use a formula to …”.
In the formula box enter the following formula.
Click the Format button and use the Font tab and change the font colour to White and click OK and then OK again.
The result is shown below.
The formula for a conditional format must return TRUE to trigger the format. The type of formula that you use is called a logical test, which returns either TRUE or FALSE.
The use of the $ signs is very important in this formula. The COUNTIF function counts the number of entries in a range. If the COUNTIF result is above 1 it is a duplicate. In cell A2 the formula will ALWAYS return 1 as it is counting itself.
When creating a formula-based condition across a range you need to build the formula to refer to the top left cell of the range. In this case we need the range to expand as the range extends down the sheet. Hence, we didn’t use any $ signs on the last two A2 references used.
In cell A3 the formula will be.
This is because the A2 references in the original formula had no $ signs, so they will change with the cell to A3. In our case this COUNTIF will return 2 because the date in cell A3 is a duplicate of the date in A2. This will trigger the format.
This formula expands as the range extends. It uses the cell reference of the cell it is in to determine if the entry is the first entry or a duplicate. This formula will not change the format of the first entry, but it will change the formats of any duplicates.
When creating data input sheets, it is a good idea to use a table layout. Sometimes they can end up looking a little bit busy, especially if you are repeating entries down rows. To help users focus on what they need to do, you can use a little formatting hack to make the layout look a little less cluttered.
One thing you learn quickly about Excel is that there are many ways to achieve the same outcome.
This is another example. In an earlier video I showed two separate ways to convert text numbers into real numbers.
Well, I have just learned another way. An Excel MVP Rick Rothstein shared a third way. I tweaked it and share a keyboard shortcut to do it as well.
Hope you enjoy it.
Added Nov 27, 2021
If you use Text to Columns for other conversion in the same session, you may need to use Alt A E W F as the Delimiter defaults may interfere with the conversion.
Would you like to display a pop-up message when a user enters a value into a cell? You don’t need a macro to achieve this.
Dynamic arrays allow you to use a function normally built to handle a cell, with a range of cells. The TRIM function can remove extra space characters in cells. So with dynamic arrays it can handle ranges.
Yes, I know you should use Power Query to clean data and I demonstrated how to do that in my previous post. Sometimes it is easier to record a macro because a macro can clean the data in place.
I recently downloaded an example file for an Excel challenge. The challenge had a lot of things to do but they were all based on a Timestamp column that had text instead of times.
The Alt key offers a way to use icons without using the mouse. In some cases, these Alt key shortcuts can be quicker than using the mouse.
Power Query Shortcut
Have you tried right clicking a formatted table recently?
There is a new option to Get Data from Table/Range – which means to import the table into Power Query so you can data cleanse the table.
20 years ago my last article for the Accountants Weekly magazine was published. They spelled my name wrong after getting it right for all the other articles, maybe that’s why I stopped.
Power Query Zoom
I used this today in a live webinar.
I zoomed into the Power Query window in Excel to make it easier to see.
Ctrl + Shift + + (plus)
In Australia our financial year starts in July. Excel is set up to work with calendar years and we need to do some date gymnastics to have our reports start in July. Here is a hack for Custom Lists that can make some things better in Excel.
There are times when pasting to the bottom of an existing large, formatted table can take a few minutes to update. There is a quicker way.
When the formatted table is selected there is a Table Design (or Design) tab visible.
On the far left-hand side the Resize Table icon allows you to easily extend the range of the formatted.
You can amend the range and add sufficient rows to handle the new data in the dialog that opens.
When you paste into an existing formatted table (rather on the end of the table) you will find it will update a lot quicker.
I covered a solution to sorting and ignoring the sign a couple of years back, but it is time to revisit this thanks to dynamic arrays.
If you have a list of first names and last names and you want to make sure the list has no duplicates you can use a formula to confirm the names are unique.
The headings in a formatted table must be unique.
Excel has two functions to answer these questions.
If you need to find if text is in a column you can use the Text.PositionOf function to confirm it exists.