I had a recent query regarding checking time in a column that had both date and time. There is an easy way to extract time from a date-time combination.
When adding labels to a chart sometimes you need a line break. Well it is possible.
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.
Display a New Window
If you have two or more screens (I have three) you can have separate Excel windows on separate screens. This can make copying and linking much easier.
The keyboard shortcut to open a new window in the current file is Alt W N pressed in sequence not held down.
This allows you to have the same file visible in two separate windows. Each window can have a separate sheet.
The New Window icon is on the View ribbon tab.
Yes, you can use emojis (those little images you see in text messages, tweets and posts) in Excel. You can even use them in formulas. 😀
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.
I posted recently about how you can amend a custom list to change the sequence of a slicer – read it here. Here is another tweak I learned from Mr Excel (Bill Jelen).
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 comma format for numbers is pretty popular.
There are a couple of keyboard shortcuts to apply it.
Hold the Ctrl and Shift keys down and press 1 on the keyboard.
The next one uses the Alt key. Use the left Alt key. Keys pressed in sequence (don’t hold them down).
Alt H K
Remember Hong Kong.
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.
Old Macros XL4 macros
If you use the old Excel macro language – known as XL4 macros – you may need to update a setting to keep using them.
This is the macro language before VBA was introduced in the Excel 5 back in the 90’s.
Not many people use these macros any more but there a couple of techniques that they are used for.
Microsoft will soon disable them automatically and you will need to turn them back on if you want to use them.
The setting to update is in the Trust Center Macro settings – see image below.
On LinkedIn recently someone posted an Excel formula solution lamenting that it was long and complex. That of course was a challenge to me to simplify it.
A good teacher does not teach facts, he or she teaches enthusiasm, open-mindedness and values.
The standard budget layout isn’t great for pivot tables. You can easily and quickly convert it in to data using Power Query
See now in this short video.
When you are developing a file for a report, budget or forecast you may need to keep track of certain cells. They could be validations or profits or some other important value. The Watch Window can help you monitor multiple cells in one place.
In the Formulas tab in the Formula Auditing section is the Watch Window icon.
Clicking the icon opens the Watch Window. It will be blank.
You can click the Add Watch button to add a cell to monitor. You can chose cells from any sheet.
Click Add to watch the cell. You can widen the Watch Window and change column widths as well.
You can click the column headings to sort by the column.
You can also select a range to watch. but it will list the range as a series of cells – see images below.
When you save and close the file the watch entries are saved. When you open the file the Watch Window won’t be open, you will have to re-open it.
The shortcut Alt M W (pressed in sequence, not held down) will open the Watch Window. The same shortcut also closes the Watch Window.
If you want to display a blank cell instead of a zero there are two ways to do it.
See both in this short video.
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.
Here’s a technique to calculate the time differences when you aren’t sure which time is first or last. Note with standard Excel settings you cannot report negative time.
Do you have a list or lists that you use all the time? Would you like to write the first entry and then drag it like January to get the rest of the list? Here’s how.
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.
If you have data that has blanks in it you may be able to combine columns using Paste Special – Skip Blanks.
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)
20 years ago I had an article published on Excel shortcuts keys – let’s revisit it.