Close Menu
Computing.net
    Facebook X (Twitter) Instagram
    Computing.netComputing.net
    • News
      1. AI
      2. Crypto
      3. Gaming
      4. Hardware
      5. Security
      6. Software
      7. View All

      Anthropic’s COBOL Automation Tool Triggers IBM Stock Plunge and Crypto Market Decline

      February 24, 2026

      AI Trading Bot Loses $441K in Crypto After Decimal Point Mistake

      February 23, 2026

      Tesla (TSLA) Stock: Goodbye Sedans, Hello Robots in Dramatic Production Shift

      January 29, 2026

      Palantir Technologies (PLTR) Stock: Why Bears May Be Wrong About Valuation Concerns

      January 29, 2026

      SUI Token Rallies 40% Following Major Staking Event and CME Futures Announcement

      May 12, 2026

      Chainlink (LINK) Surges to $10.40 as Network Activity Hits Eight-Month Peak

      May 12, 2026

      Dogecoin Whales Ramp Up Accumulation as DOGE Eyes Critical Breakout Levels

      May 12, 2026

      Bitcoin Holds $81K While Burry Flags Nasdaq Bubble and Oil Surges Past $105

      May 12, 2026

      Hamster Kombat: Unraveling TON’s Gaming Phenomenon

      August 7, 2024

      W-Coin: Exploring the Latest Telegram Tap-to-Earn Phenomenon

      August 7, 2024

      Hamster Kombat: 300 Million Players & Counting, HMSTR Token Airdrop Soon!

      July 31, 2024

      Hamster Kombat Developers Work with TON Team on Airdrop Solution

      July 30, 2024

      Nothing Expands Product Line with New AI Feature & Phone Update

      July 31, 2024

      Security Audit Reveals Concerns in Atari’s Blockchain Game on Base

      August 6, 2024

      SideWinder Group Targets Maritime Facilities in New Cyber Espionage Campaign

      July 30, 2024

      OAuth Implementation Flaw Exposes Millions of Websites to XSS Attacks

      July 30, 2024

      Hamster Kombat Players Face Growing Cybersecurity Threats

      July 25, 2024

      Anthropic’s COBOL Automation Tool Triggers IBM Stock Plunge and Crypto Market Decline

      February 24, 2026

      Cookie Crumble: Google Halts Plans to Eliminate Third-Party Cookies in Chrome

      July 23, 2024

      Big Brother is Watching: Apple’s Creepy New Ad Urges iPhone Users to Ditch Chrome

      July 23, 2024

      Nvidia Stock Soars to New Record at $219.44 Ahead of May 20 Earnings

      May 12, 2026

      Rocket Lab Shares Surge Past $120 Following Wave of Analyst Upgrades

      May 12, 2026

      GM Shares Decline Following 600 IT Layoffs Amid Strategic AI Workforce Transformation

      May 12, 2026

      SES Delivers €847M Q1 Performance as Intelsat Integration and Aviation Deals Fuel Expansion

      May 12, 2026
    • How To

      Batch Files: Tokens and Delimiters (FOR Loops)

      July 31, 2024

      Types of Ethernet Cabling & Electrical Low Voltage Wiring

      July 9, 2024

      What You Should Know About .JSON File Extension

      January 10, 2023

      Bkup File Extension

      November 19, 2022

      HEIC File Extension

      November 19, 2022
    • Office
      1. Excel
      2. Google Sheets
      3. View All

      How to Convert Column List to Comma Separated List in Excel

      July 24, 2024

      How to Find the Last Monday of the Month in Excel

      July 24, 2024

      Convert Bytes to MB or GB in Excel: 3 Methods!

      July 24, 2024

      How to Remove Characters from Right in Excel

      July 30, 2023

      How to Subtract in Google Sheets: Complete Guide

      July 31, 2024

      Bullet Points in Google Sheets

      January 20, 2022

      Sort by Date in Google Sheets

      January 18, 2022

      Google Sheets Timestamp

      January 17, 2022

      How to Subtract in Google Sheets: Complete Guide

      July 31, 2024

      How to Convert Column List to Comma Separated List in Excel

      July 24, 2024

      How to Find the Last Monday of the Month in Excel

      July 24, 2024

      Convert Bytes to MB or GB in Excel: 3 Methods!

      July 24, 2024
    • Answers
    • About
    • Contact
    Facebook X (Twitter)
    Computing.net
    Google Sheets

    Highlight Duplicates in Google Sheets

    Constantin KioulafasBy Constantin KioulafasJanuary 7, 2022
    Twitter LinkedIn Email Telegram
    Highlight Duplicates in Google Sheets
    Twitter LinkedIn Email Telegram

    Highlighting duplicates is handy when you are comparing data to see where there’s a match, or going through trying to filter out double entries.

    We’ll be taking a look at ways Google sheets gives you for doing this using Conditional formatting.

    We’ll start with a simple, single column example and work on to more complex situations.

    Our examples will include a small dataset but the principle is the same regardless of whether there are 10 rows or 1000 rows.

    Contents:

    Toggle
    • Conditional Formatting
    • COUNTIF
    • Sample Usage
    • Syntax
    • Notes
    • ARRAYFORMULA
    • Sample Usage
    • Syntax
    • Notes
    • Conclusion

    Conditional Formatting

    Google sheets offers a conditional formatting option which allows the user to create a rules based formatting strategy based on one or more criteria.

    There are a number of predefined rules that can be used to test against text, dates and numbers.

    You can also define a custom formula, and this is what we will be using.

    In our first example, we have a list of email addresses and we want to highlight only those rows that constitute duplicates.

    We begin by selecting the range of cells on which we want to test.

    How we make this selection impacts on how we structure our custom formula.

    In the screenshot above, we’ve highlighted the range of cells A2 to A25.

    Then, we select Conditional formatting, available from Google sheet’s Format menu option.

    This will open the Conditional format rules pane on the far right hand side.

    The first thing to notice is the Apply to range section, which by default has the range of cells we highlighted previously.

    We can manually change this if we wanted to include more cells in the range, but as we’ll see in a moment, this range has to coincide with our custom formula.

    The next section, Format rules, is where we select what rules will be used on our selected range of cells from the dropdown menu.

    Since none of the predefined rules help in finding duplicates, we need to use a formula, by selecting the last option, Custom formula is.

    This adds a new field to the Formula rules section, Value or formula.

    It is here where we define the formula that will find any duplicates in our email addresses.

    Our formula is going to use the COUNTIF function.

    The following function definition is taken from the Google sheets documentation.

    COUNTIF

    Returns a conditional count across a range.

    Sample Usage

    COUNTIF(A1:A10,”>20″)

    COUNTIF(A1:A10,”Paid”)

    Syntax

    COUNTIF(range, criterion)

    • range – The range that is tested against criterion.
    • criterion – The pattern or test to apply to range.
      • If range contains text to check against, criterion must be a string. criterion can contain wildcards including ? to match any single character or * to match zero or more contiguous characters. To match an actual question mark or asterisk, prefix the character with the tilde (~) character (i.e. ~? and ~*). A string criterion must be enclosed in quotation marks. Each cell in range is then checked against criterion for equality (or match, if wildcards are used).
      • If range contains numbers to check against, criterion may be either a string or a number. If a number is provided, each cell in range is checked for equality with criterion. Otherwise, criterion may be a string containing a number (which also checks for equality), or a number prefixed with any of the following operators: =, >, >=, <, or <=, which check whether the range cell is equal to, greater than, greater than or equal to, less than, or less than or equal to the criterion value, respectively.

    Notes

    • COUNTIF can only perform conditional counts with a single criterion. To use multiple criteria, use COUNTIFS or the database functions DCOUNT or DCOUNTA.
    • COUNTIF is not case sensitive.

    The formula we are going to use is
    =COUNTIF ($A$2:$A$25, A2) > 1

    COUNTIF takes two parameters, the range ($A$2:$A$25), and the criterion (A2), and what we are looking for is a count that is greater than 1.

    In our example, the range of cells used is from A2 to A25 inclusive.

    When setting the range parameter in the COUNTIF function call, we need to use absolute cell referencing (we’ll see in a second why), hence we prepend both the column letter and row number with the dollar symbol, $A$2:$A$25.

    COUNTIF then uses the criterion parameter, checking it against all the cells in the range, incrementing a counter every time a match (i.e. duplicate) is found.

    In our formula, we’ve provided cell A2 as the criterion, but passed it as a relative cell reference (no $ symbol).

    The Conditional format rules will use the Apply to range setting, moving down each cell in the range, applying the formula.

    This is where absolute and relative referencing are important.

    Since the range parameter in the formula uses absolute referencing, the range remains fixed.

    The criterion parameter on the other hand, is a relative cell reference, so it will be adjusted with each call as Conditional format rules iterates past each cell. Each of cells A2 to A25 in turn, will be compared against the entire range and tested for duplicates.

    Before finishing, we can adjust the nature of the highlighting to be applied, from the Formatting style section.

    Here, we can select a different background fill color, or apply text formatting such as bold or underlined.

    With the formula entered in the Value or formula field, and the formatting style set, left mouse click on the Done button.

    The end result is that the rule will be applied and any duplicates will be highlighted, as shown in the above screenshot.

    The previous example highlighted a single column, but what if we wanted to highlight duplicates that spanned two or more columns, as in the case of where our email addresses also had name fields.

    In the above screenshot, we have the same email addresses as before, but now there are the corresponding first and last name columns.

    The aim again is to find any duplicate emails, but this time we’d like rows across all three columns to be highlighted.

    The process is exactly the same as before, with just a couple of very minor changes.

    The first is to the range of cells in the Apply to range section in the Conditional format rules, which now becomes A2:C25 to cover all three columns.

    The second change is to our formula where, here too, we simply change the column reference $A$25 to $C$25 so that it also covers the three columns.

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

    The result is seen in the screenshot above where duplicates are highlighted across the three columns.

    Notice now what happens when we change the email address in row 11, from vmondella@mondella.com to vallie@mondella.com.

    The duplicates for vmondella@mondella.com in the EMAIL column (rows 4 and 11) have now lost their highlighting, however the corresponding cells in the FIRST NAME and LAST NAME columns are still hightlighted.

    This shows that the conditional formatting is applied to each individual cell independently, irrespective of which column it is under.

    In other words, in row 4, the name Vallie in the FIRST NAME column also exists in row 11, and so is a duplicate.

    This may be the behavior you were looking for, especially if you are after all duplicates, regardless of where they occur.

    However, if instead you wanted to highlight the row but only when it matches on the EMAIL, we need to tweak the formula ever so slightly, taking advantage of cell referencing. Our new formula is now:

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

    The difference is in the criterion parameter, which is now $A2. This means that the column (A) is absolute while the row remains relative.

    Even though the range covers columns A to C, using an absolute column reference ensures that the search for duplicates will only apply to column A, the EMAIL column.

    The result is now that the entire row is highlighted but only for duplicates that occur in the EMAIL column.

    Yet another variation is checking for duplicate rows (i.e. where all three columns match), and for this we need to again modify our formula.

    The aim now is to find duplicates where the EMAIL, FIRST NAME, and LAST NAME columns match as a row and not as individual cells.

    The problem is that the Conditional format rules and the COUNTIF function cannot operate on columns as a set.

    To get around this, we will use the ARRAYFORMULA function. Here is the definition for ARRAYFORMULA.

    ARRAYFORMULA

    Enables the display of values returned from an array formula into multiple rows and/or columns and the use of non-array functions with arrays.

    Sample Usage

    ARRAYFORMULA(SUM(IF(A1:A10>5, A1:A10, 0)))

    ARRAYFORMULA(A1:C1+A2:C2)

    Syntax

    ARRAYFORMULA(array_formula)

    • array_formula – A range, mathematical expression using one cell range or multiple ranges of the same size, or a function that returns a result greater than one cell.

    Notes

    • Many array formulas will be automatically expanded into neighboring cells, obviating the explicit use of ARRAYFORMULA.
    • Pressing Ctrl+Shift+Enter while editing a formula will automatically add ARRAYFORMULA( to the beginning of the formula.
    • Note that array formulas cannot be exported.

    ARRAYFORMULA will allow us to combine the EMAIL, FIRST NAME, and LAST NAME columns into a single column (or array) and pass that to the COUNTIF function.

    Here is the new formula:

    =COUNTIF (ARRAYFORMULA ($A$2:$A$25 & $B$2:$B$25 & $C$2:$C$25), $A2 & $B2 & $C2) > 1

    Apart from the ARRAYFORMULA function, we’ve also introduced the use of the ampersand (&) which is the concatenation operator. It concatenates or combines its operands.

    It is used in the ARRAYFORMULA function to combine the EMAIL, FIRST NAME, and LAST NAME columns.

    ARRAYFORMULA then converts the concatenation into a single column (or array) which the COUNTIF function can handle.

    We also concatenate the EMAIL, FIRST NAME, and LAST NAME cells for the criterion parameter, $A2 & $B2 & $C2.

    Note here too, the use of absolute referencing with respect to the columns, while still using relative referencing for the row.

    The result is that the formula searches for duplicates only in the EMAIL column, but if found, highlights the row across the three columns.

    Conclusion

    As we’ve seen, the Conditional formatting option provides a very convenient way to highlight duplicates using custom formulas.

    With the use of the COUNTIF and ARRAYFORMULA functions, coupled with subtle changes in cell referencing, a variety of options for determining duplicates become available.

    Share. Twitter LinkedIn Email Telegram
    Avatar photo
    Constantin Kioulafas
    • LinkedIn

    Costas has a wide range of experience in Information Technology covering computer hardware, programming, telecommunications, networking, web services, and general IT support. He's worked in various roles such as PHP programmer and web developer, technical and desktop support, hardware repair, system administration. Costas has excellent background in Microsoft Windows and Office Suite (Excel, Word, Powerpoint, etc), as well as a thorough understanding of Networking and Hardware maintenance.

    Related Posts

    How to Subtract in Google Sheets: Complete Guide

    July 31, 2024

    How to Find the Last Monday of the Month in Excel

    July 24, 2024

    Convert Bytes to MB or GB in Excel: 3 Methods!

    July 24, 2024

    What is Information Technology? – Definition, Types, and Examples

    December 6, 2022

    How to Create a Box Plot in Microsoft Excel

    March 1, 2022

    How to Create Bar of Pie Chart in Excel

    March 1, 2022
    Add A Comment

    Comments are closed.

    Latest

    Nvidia Stock Soars to New Record at $219.44 Ahead of May 20 Earnings

    May 12, 2026

    Rocket Lab Shares Surge Past $120 Following Wave of Analyst Upgrades

    May 12, 2026

    GM Shares Decline Following 600 IT Layoffs Amid Strategic AI Workforce Transformation

    May 12, 2026

    SES Delivers €847M Q1 Performance as Intelsat Integration and Aviation Deals Fuel Expansion

    May 12, 2026

    Trump Dismisses Iran Peace Proposal — Oil Markets React as Hormuz Remains Restricted

    May 12, 2026
    • Facebook
    • Twitter

    Latest Reviews

    Meta Platforms Shares Tumble 8% Despite Strong Q1 Performance Amid AI Investment Surge

    April 30, 2026

    Flush.com Review: Casino & Sportsbook With 275% Welcome Bonus

    March 7, 2026

    Katsubet Review: Crypto Casino With 300% Welcome Bonus & Free Spins

    March 7, 2026

    7Bit Review: Crypto Casino With 325% Bonus & 250 FS

    March 7, 2026

    Mega Dice Review: Crypto Casino With 200% Bonus & 50 Free Spins, Legit?

    March 7, 2026


    Home / Privacy Policy / Terms & Conditions

    Computing.net © 1996 - 2026 Kooc Media Ltd. All rights reserved. Registered Company No.05695741

    Type above and press Enter to search. Press Esc to cancel.