Conditional Format to Display Only the First Entry

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.

=COUNTIF($A$2:A2,A2)>1

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.

=COUNTIF($A$2:A3,A3)>1

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.

Input Data Display Hack for Excel

Getting the format white

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 Minute to Excel #23 – Text numbers to real number again

Another solution

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.

 

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.

Related Posts

 

 

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)

Pasting into a Large Formatted Table

There is a quick way to do this

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.

Excel Power Query and Multiple Files [one hour video]

Includes detailed pdf manual

Getting data into Excel and in the correct layout and format is the important starting point for any Excel project.

Power Query can automate the importation process. It is now a vital skill to possess.

This is a follow up session to the Introduction session which you can view here.

This session focuses on importing multiple files from a folder. The session uses CSV and Excel files plus Excel tables.

This is a video of a free live training session I ran in May 2021 – over 100 people attended – please share this resource with friends and colleagues. No editing has been done to the video.

(Apologies I did have a coughing fit – I thought I had turned off the microphone but I hadn’t.)

Use the button below to download the pdf manual and example files so you can follow along.

We need to get the word out on this powerful Excel feature.

(Note: Power Query is also part of Power BI, the skills you learn also apply to that.)

Download Materials

Introduction To Excel Power Query [one hour video]

Includes detailed pdf manual

Getting data into Excel and in the correct layout and format is the important starting point for any Excel project.

Power Query can automate the importation process.

It is now a vital skill to possess.

This is a video of a free live training session I ran in May 2021 – over 100 people attended – please share this resource with friends and colleagues. No editing has been done to the video.

Use the button below to download the pdf manual and example files so you can follow along.

We need to get the word out on this powerful Excel feature.

(Note: Power Query is also part of Power BI, the skills you learn also apply to that.)

Download Materials

Open the Power Query Editor

If you have cell selected in the output table from a Power Query, you can press, in sequence (not held down) the following keys Alt P U E to open the Power Query Editor window.

Related Posts

 

One Minute to Excel #11 – Add % to a Pivot Table

It is not intuitive

Often people perform calculations off to the right of Pivot Tables to calculate percentages.

In this short video I show you those calculations can be done inside the Pivot Table itself.

The solution is not intuitive, but it is easy.

This example builds upon the previous One Minute to Excel post.

Pivot Table Shortcuts

Here’s a couple of useful keyboard shortcuts for Pivot Tables.

Display/Hide the Pivot Table Field List – this list lets you create or change the Pivot Table.

Alt J T L  – pressed in sequence, not held down.

 

To add Subtotals above the entries in an existing Pivot Table.

Alt J Y T T – again pressed in sequence, not held down.

Related Posts

One Minute to Excel #10 – Create a Pivot Table

It is easy

Note sure why, but Pivot Tables are often seen a “hard” or “advanced”.

In the short video we see how easy they are.

Oops – I go over my one minute time limit by a few seconds because I format the Pivot Table as well.