Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Karen
 
Posts: n/a
Default Replace Error with a Dash

I have a cell with the following formula:
{=AVERAGE(IF(B4:M4<0,B4:M4))}
It's producing the infamous #DIV/0! error - When the cell produces this
error, I just want a dash in its place. How can this be done?

Thank you
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gizmo63
 
Posts: n/a
Default Replace Error with a Dash

Wrap it all in an if and test for an error:
=if(iserror(AVERAGE(IF(B4:M4<0,B4:M4))),"-",AVERAGE(IF(B4:M4<0,B4:M4)))

Note: when using "-" keep in mind other formulas referring to this cell. If
you're doing a calculation then a "-" will produce an error.
You may be better setting the error value to 0 (zero) and using the
formatting to show a dash.

HTH

Giz

"Karen" wrote:

I have a cell with the following formula:
{=AVERAGE(IF(B4:M4<0,B4:M4))}
It's producing the infamous #DIV/0! error - When the cell produces this
error, I just want a dash in its place. How can this be done?

Thank you

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Karen
 
Posts: n/a
Default Replace Error with a Dash

Thank you for your help - I used this formula on a cell that should not
produce a zero, it should average the numbers and I'm getting a dash. Do you
know what is wrong?
Thank you

"Gizmo63" wrote:

Wrap it all in an if and test for an error:
=if(iserror(AVERAGE(IF(B4:M4<0,B4:M4))),"-",AVERAGE(IF(B4:M4<0,B4:M4)))

Note: when using "-" keep in mind other formulas referring to this cell. If
you're doing a calculation then a "-" will produce an error.
You may be better setting the error value to 0 (zero) and using the
formatting to show a dash.

HTH

Giz

"Karen" wrote:

I have a cell with the following formula:
{=AVERAGE(IF(B4:M4<0,B4:M4))}
It's producing the infamous #DIV/0! error - When the cell produces this
error, I just want a dash in its place. How can this be done?

Thank you

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Karen
 
Posts: n/a
Default Replace Error with a Dash

Thank you - It works great!
It wasn't working before because I didn't Ctrl + Shift + Enter
Thanks again

"Gizmo63" wrote:

Wrap it all in an if and test for an error:
=if(iserror(AVERAGE(IF(B4:M4<0,B4:M4))),"-",AVERAGE(IF(B4:M4<0,B4:M4)))

Note: when using "-" keep in mind other formulas referring to this cell. If
you're doing a calculation then a "-" will produce an error.
You may be better setting the error value to 0 (zero) and using the
formatting to show a dash.

HTH

Giz

"Karen" wrote:

I have a cell with the following formula:
{=AVERAGE(IF(B4:M4<0,B4:M4))}
It's producing the infamous #DIV/0! error - When the cell produces this
error, I just want a dash in its place. How can this be done?

Thank you

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel: Add replace within selection functionality Marcel XL Excel Discussion (Misc queries) 1 March 3rd 06 01:51 PM
Search and replace Subu Excel Worksheet Functions 4 June 9th 05 07:01 PM
replace absolute references bj Excel Worksheet Functions 0 May 20th 05 07:18 PM
Replace Number with Text using Macro Carter68 Excel Discussion (Misc queries) 3 April 19th 05 08:57 PM
VB Find and Replace Bony_Pony Excel Worksheet Functions 10 December 6th 04 05:45 PM


All times are GMT +1. The time now is 06:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"