Ora

How do I select odd cells in Google Sheets?

Published in Google Sheets Functions 4 mins read

To "select odd cells" in Google Sheets typically refers to identifying, highlighting, or extracting cells based on whether their values are odd numbers. You can achieve this effectively using conditional formatting, data filtering, or advanced formulas like ARRAYFORMULA with the ISODD() function.

Here's how to manage odd cells in Google Sheets:

Highlighting Cells with Odd Values (Conditional Formatting)

Conditional formatting is the most straightforward way to visually identify cells containing odd numbers. This method changes the formatting (e.g., background color, text style) of cells that meet a specific criterion.

  1. Select Your Range: Highlight the cells or columns where you want to identify odd values (e.g., A1:C100).
  2. Open Conditional Formatting: Go to the menu bar and click Format > Conditional formatting.
  3. Set Format Rules:
    • Under "Format rules," ensure the "Apply to range" accurately reflects your selection.
    • For "Format rules," select Custom formula is from the "Format cells if..." dropdown.
    • Enter the custom formula: =ISODD(A1)
      • Note: Replace A1 with the top-left cell of your selected range. Google Sheets automatically adjusts this formula for other cells in the range.
    • Choose Formatting Style: Under "Formatting style," select your desired fill color, text color, or font style to make the odd numbers stand out.
  4. Click Done: The odd-numbered cells in your selected range will now be highlighted.

Example: Highlighting Odd Values

Number Result (Formatted)
1 1
2 2
3 3
4 4
5 5
  • Conditional Formatting Formula applied to A:A: =ISODD(A1)

Filtering for Odd Cell Values

If you want to temporarily display only rows that contain odd values in a specific column, filtering is a great solution.

  1. Select Your Data Range: Select the entire range of data you want to filter, including headers (e.g., A1:D100).
  2. Create a Filter: Go to Data > Create a filter. Filter icons will appear in the header row of your selected range.
  3. Apply Custom Filter Condition:
    • Click on the filter icon in the header of the column you want to check for odd values (e.g., column A).
    • From the filter menu, select Filter by condition.
    • Choose Custom formula is from the dropdown.
    • Enter the custom formula: =ISODD(A2)
      • Note: Replace A2 with the first data cell (below the header) of the column you are filtering.
    • Click OK.

Your sheet will now only display rows where the value in the specified column is an odd number. To remove the filter, go to Data > Remove filter.

Using ARRAYFORMULA with ISODD to Process Ranges

For more dynamic and powerful analysis across an entire range, you can combine ARRAYFORMULA with ISODD(). This approach is particularly useful for generating a new column indicating whether values are odd or for extracting all odd numbers from a list. An array formula can apply functions like ISODD to an entire range efficiently, rather than dragging a formula down cell by cell.

Here are some practical applications:

  • Identifying Odd Values in a New Column: To create a new column that explicitly states "Odd" or "Even" for each value in an existing column:

    =ARRAYFORMULA(IF(ISODD(A1:A), "Odd", "Even"))

    This formula, placed in an empty cell (e.g., B1), will generate "Odd" or "Even" for every corresponding cell in column A.

  • Extracting Only Odd Values with FILTER: To create a list containing only the odd numbers from a specified range:

    =FILTER(A:A, ARRAYFORMULA(ISODD(A:A)))

    This formula will dynamically pull all odd numbers from column A into a new, consolidated list in the column where you place the formula.

Example: ARRAYFORMULA for Odd/Even Identification

Original Numbers (A) ARRAYFORMULA Output (B)
1 Odd
2 Even
3 Odd
4 Even
5 Odd
  • Formula in B1: =ARRAYFORMULA(IF(ISODD(A1:A), "Odd", "Even"))

Selecting Cells in Odd-Numbered Rows or Columns (Positional Selection)

If "odd cells" refers to their position (e.g., cells in row 1, 3, 5, etc.) rather than their value, you can use the ROW() or COLUMN() functions with conditional formatting.

  • Highlighting Odd Rows:

    • Select your data range.
    • Go to Format > Conditional formatting.
    • Choose "Custom formula is" and enter: =ISODD(ROW())
    • Select your desired formatting. This will highlight every odd-numbered row in your selected range.
  • Highlighting Odd Columns:

    • Select your data range.
    • Go to Format > Conditional formatting.
    • Choose "Custom formula is" and enter: =ISODD(COLUMN())
    • Select your desired formatting. This will highlight every odd-numbered column in your selected range.