5 Ways to Show Zero as Dashes in Google Sheets (2023)

This post will show you all the ways to display your null values ​​as hyphens or hyphens in Google Sheets.

Does the number zero appear frequently in your data set and you want to display it in a way that distinguishes it from other values?

Null means the absence of something, but having them appear in a dataset, especially when there are few of them, can make the dataset feel unnecessarily cluttered and overwhelming.

There's a trick to changing all the zeros in your spreadsheet: replace them with a hyphen. But you can use any character of your choice to replace zeros in your spreadsheet.

In this exercise, we'll show you methods you can use to display zeros in your spreadsheet as a dash.

The methods that will be discussed are listed below.

  • custom number formats.
  • TEXTfunction.
  • CONSULTATIONfunction.
  • SEfunction.
  • find and replace.

Get your copy of the sample workbook and stick with it.

Show zero as dash with custom number formats

There are several predefined number format options in the spreadsheet.

When that's not enough, you can usecustom number formats, which allows you to set a number format of your choice.

5 Ways to Show Zero as Dashes in Google Sheets (1)

you can accesscustom number formatsresource ofFormatmenu.

  1. YeahFormatmenu.
  2. chooseNumberof the possibilities.
  3. choosecustom number formatin the submenu settings.
5 Ways to Show Zero as Dashes in Google Sheets (2)

After clickingcustom number formatsofNumberdropdown options, acustom number formatsThe dialog opens.

The text box in the dialog allows you to pass format syntax for four categories of values.

  1. Positive: Receive format instructions for positive numbers
  2. Negative: Receive format instructions for negative numbers
  3. null: Allows you to format declarations to display null values.
  4. Text: allows you to pass formatting statements to text values

The section below the text box shows what each format statement will look like. Special characters and symbols are used to send format instructions.

You can, for example,use a custom number format to display values ​​in accounting format.

To indicate the end of the format syntax section of one category and the beginning of another, use the semicolon character;.

5 Ways to Show Zero as Dashes in Google Sheets (3)

Usingcustom number formats, first select the cell or range of cells you want to format.

5 Ways to Show Zero as Dashes in Google Sheets (4)
#,##0; [rojo]#,##0; -

Copy and paste the above syntax intocustom number formatstext box and clickapplybutton.

💡Advice: You also canuse custom formats to display zeros as spaces!

5 Ways to Show Zero as Dashes in Google Sheets (5)

All zeros in your data are now represented by a hyphen.

📝Observation: Custom format allows the value to remain unchanged; it only changes the way the value is displayed. When you select the cell, you will still see zerovalue displayed in the formula bar.

Display zero as hyphen with TEXT function

5 Ways to Show Zero as Dashes in Google Sheets (6)

ohTEXTThe function does exactly what the name suggests. Convert values ​​to text format. You can also use this to apply custom formatting to the text value.

= TEXT(from, format)
  • numberThis is where you enter the cells or cell ranges with the values ​​you want to format.
  • FormatThis is where you post your formatting instructions. The format instructions use symbols and characters similar to those used incustom number formats. don't argueFormatsection must be enclosed in double quotes"".
5 Ways to Show Zero as Dashes in Google Sheets (7)
= TEXTO (D2, "#,##0;#,##0;-" )

Select an empty cell and paste the above formula. Use the fill handle to copy the formula to other cells.

📝Observation:OTEXTconverts values ​​to text or string. Even though you see numbers, it's a text value for Google Sheets.

This means that no calculations can be made based on these numbers, which is a disadvantage. WearTEXTwill only work if no further numerical calculations are required.

Display zero as hyphen with QUERY function

ohCONSULTATIONThe function is a very powerful tool in Google Sheets that allows you to perform various types of calculations and data manipulation using SQL-like statements.

Watch thisComplete guide to the QUERY functionfor more details.

5 Ways to Show Zero as Dashes in Google Sheets (8)
=QUERY(data, query, [header])
  • datais the range of cells that contain your data.
  • consultationshould contain the operational command you want to run on yourdata. Everything in this argument must be in quotes."".
  • headerindicates the number of rows that are column headers. This is an optional argument, but if left blank, the function will approximate the row to the column headers. The argument takes numeric values.
5 Ways to Show Zero as Dashes in Google Sheets (9)
=QUERY(D2:D7, "format D '#,##0; [red]#,##0; -'", 0 )

Copy and paste the above formula into your workbook. Note that the query format syntax is enclosed in single quotes.'.

📝Observation:OCONSULTATIONThe function preserves the values ​​as numbers even when a format is applied. You can easily apply additional numerical calculations to the results.

Display zero as hyphen with IF function

5 Ways to Show Zero as Dashes in Google Sheets (10)

ohSEThe function allows you to return one of two values ​​based on a logical test.

= IF(logical_expression, value_if_true, value_if_false)
  • logical_expressionthis is where you define the condition that determines which valuesSEthe function returns. Logical expressions must return a true or false Boolean value.
  • value_if_truethis is where you define what to return iflogical_expressionand the truth.
  • value_set_falsethis is where you define what to return iflogical_expressionit's false.

when you dominateSEsyntax, you will use it quite often because of its adaptability to different situations.

5 Ways to Show Zero as Dashes in Google Sheets (11)

In the illustrations above, the values ​​inunsoldThe column was already derived before they changed its format. This will not be the case forSEfunction.

Instead of calculating the values ​​before changing the format, we useSEfunction to get the value and change any null value to a hyphen.

5 Ways to Show Zero as Dashes in Google Sheets (12)
= SE (B2-C2 = 0, "-", B2-C2 )

Copy and paste the above formula into an empty cell on the spreadsheet. Drag the fill handle down on the empty cells to copy the formula into them.

5 Ways to Show Zero as Dashes in Google Sheets (13)

The benefit of usingSEThe feature in this situation is that you can still do calculations with the column. This is possible because text values ​​in the column are ignored or classified as null, and calculations are performed on numeric values.

Show zero as dashes with Find and Replace

find and replaceis a function that you can use to search for characters and replace them with other characters.

You can use this function to replace all null values ​​with a hyphen.

5 Ways to Show Zero as Dashes in Google Sheets (14)

you have access tofind and replacefunction on the Edit menu tab.

  1. Yeahto editmenu.
  2. choosefind and replaceof the possibilities.

You can also use the keyboard shortcut.Control+hOpenfind and replacedialog box.

5 Ways to Show Zero as Dashes in Google Sheets (15)

In the dialog there are three command sections.

  1. MeetThis is where you enter the character you want to appear on your spreadsheet.
  2. replace withthis is where you enter the replacement character
  3. Look forthis is where you define your search parameters.
5 Ways to Show Zero as Dashes in Google Sheets (16)

ohall worksheetsThe command allows you to find and replace characters anywhere on the worksheet.This sheetallows you to find and replace characters in the active worksheet, whilecertain rangeThe option allows searching with a selected range.

5 Ways to Show Zero as Dashes in Google Sheets (17)

The other sets of options are used to define how the character search should be performed.

paired upAllows character search to be case sensitive. If you check this box and have aINNoMeetbox, the search will only look for oneIN, arein.when searching0values, this will not be relevant.

ohCombine all cell contentto allowfind and replaceto return only cells that exactly matchMeetworth. If eg. check this box and search"mi", although other cells contain the word, so far the cell contains other words,find and replaceYou won't notice. Instead, it will capture cells that only contain the word."mi".

ohSearch using regular expressionsallows you to search using special characters and symbols, such as those used when defining formatting rules incustom number format.

ohSearch also in formulasThe option allows you to include formulas in a search.

5 Ways to Show Zero as Dashes in Google Sheets (18)

before being able to usefind and replacefunction to change zeros to dashes, copy and paste values, a copy of their values, so as not to change the original source data.

you should also useconvert any formula to valuessince find and replace will not be able to replace zeros derived by formulas.

Select the column and useControl+Cto copy select an empty cell and useControl+Change+Vto insert the values.

5 Ways to Show Zero as Dashes in Google Sheets (19)
  1. Select the range of cells you want to work with. then openfind and replacedialog box.
  2. Place0NoMeetbooks.
  3. draw a line-Noreplace withbooks.
  4. click notLook forchance and choicecertain range.
  5. Check the square box in frontCombine all cell contentpossibility.
  6. click notreplace everythingbutton.
5 Ways to Show Zero as Dashes in Google Sheets (20)

As soon as you clickreplace everything, you will be notified that the replacement has been made and it will tell you how many zeros were replaced.

you can clickmadeto exit the dialog.

conclusions

Converting zeros to dashes can make your data set easier to read, and there are many methods you can use to accomplish this.

If you don't expect any changes to your data, use onecustom number formatsor by usingfind and replaceThe method will be the perfect option.

MenTEXToCONSULTATIONFeatures may be a more sustainable option as your data expands in the future. However, you should avoid the TEXT function if you intend to apply some more numerical calculations to your numbers.

UserSEThe function does not require an additional column to produce the result of converting zero to a hyphen.

Have you ever displayed your null values ​​as hyphens or some other character? Do you use another method for this? Let me know below in the comments!

FAQs

How do I format zeros as dashes in Google Sheets? ›

Here's how:
  1. Highlight the table.
  2. Go to the Home tab.
  3. Click on the Conditional Formatting button.
  4. Choose Highlight Cells Rules.
  5. Choose Text That Contains.
  6. In the pop-up window, type a dash.
  7. Instead of “Light Red Fill with Dark Red Text,” go to the bottom of the drop-down list, and choose Custom Format.
Dec 5, 2022

How do you show 0 in a cell in Google Sheets? ›

Add Apostrophe (') Before the Number

All you need to do is first type an apostrophe (') symbol and then type the number. So if you want the value in the cell to be 000123, you should enter '000123. Adding an apostrophe converts the number you enter into text, and the leading zeros don't go away.

How do you change zeros to dashes? ›

Converting Zeroes to Dashes Using Find and Replace
  1. Let us consider an Excel sheet where the data in the sheet is similar to the data shown in the below image. ...
  2. Then click on replace and type 0 in find what and – in replace with, then click on replace all as shown in the below image to complete our process.
Mar 7, 2023

How do you write a zero with a dash? ›

Show Zero as Dash with Custom Format
  1. Go to the Number tab in the Format Cells menu.
  2. Select the Custom option in the Category section.
  3. Enter the #,##0;-#,##0;- format string into the Type field.
  4. Press the OK button.

How do you show zeros in front of a number on a spreadsheet? ›

Apply Custom Format with Leading Zeros
  1. Select the cell in which you want to add zeros as a prefix.
  2. Right-click ➜ Format Option or you can also use the shortcut key Ctrl + 1 open “Format Cell Dialog Box”.
  3. In Category ➜ Select Custom.
  4. In the custom input dialog box, enter “0000000”.
  5. Click OK.

Why can't i put 0 in Google Sheets? ›

Google Sheets removes leading zeros if you type a number with them inside any cell. A common practice most of the users follow is changing the format of cells. If you change the format of the cells as text, you can easily store the numbers with leading zeros as the system will consider them as text inside those cells.

How do you make blank cells show a dash? ›

Instead of pressing Enter, press Ctrl + Enter to enter the dash symbol in all of the selected blank cells, as shown in Figure D.

How do I automatically insert dashes in Excel? ›

Inserting Dashes between Letters and Numbers in Excel
  1. Select the cell or range of cells where you want to insert the dashes.
  2. Click the Home tab.
  3. In the Font group, click the Insert drop-down arrow.
  4. Click Special Characters. A dialog box appears.
  5. In the Symbol tab, select the character you want to insert. ...
  6. Click Insert.

How do you insert a dash? ›

For desktop PC: press “alt+ctrl+minus” on the numeric keypad (the number section on the far right of your keyboard). The trick will not work if you press the hyphen-key on the typewriter section of the keyboard.

How do you dash on Google? ›

Tap the hyphen key twice type your word, and then press the spacebar. You'll see Google Docs change the hyphens to an em dash. Windows users accessing Google Docs in a web browser can create an em dash by holding the Alt key and typing 0151 on the numpad. This shortcut also works in other apps.

How do you insert a dash symbol? ›

For Windows on a keyboard with a numeric keypad: Use Alt + 0 1 5 0 (en dash) or Alt + 0 1 5 1 (em dash) using the numeric keypad.

How do I fix number format in Google Sheets? ›

To apply a custom number format to your spreadsheet:
  1. On your computer, open a spreadsheet in Google Sheets.
  2. Highlight the data you want to format.
  3. Click Format Number.
  4. Click Custom number format.
  5. Search in the menu text box to select a format. ...
  6. Click Apply.

How do I show zeros negative in Google Sheets? ›

Display Negative Values as Zeros

Instead, we can change the number formatting to 0;”0”;0. This will display negative numbers as zero.

How do you make a cell show blank instead of zero? ›

Click the File tab, choose Options in the left pane and then click Advanced in the left pane. 2. In the Display options for this worksheet section, uncheck Show a zero in cells that have zero value (Figure A).

References

Top Articles
Latest Posts
Article information

Author: Greg Kuvalis

Last Updated: 27/12/2023

Views: 6755

Rating: 4.4 / 5 (75 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Greg Kuvalis

Birthday: 1996-12-20

Address: 53157 Trantow Inlet, Townemouth, FL 92564-0267

Phone: +68218650356656

Job: IT Representative

Hobby: Knitting, Amateur radio, Skiing, Running, Mountain biking, Slacklining, Electronics

Introduction: My name is Greg Kuvalis, I am a witty, spotless, beautiful, charming, delightful, thankful, beautiful person who loves writing and wants to share my knowledge and understanding with you.