Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 24
Default Using ISERROR with more than 2 cells of data

I have a worksheet with breakdown calculations of hours worked in a given day
for a person (morning block of time, afternoon block of time & possibly a
third block of time). I am now attempting to calculate the total number of
hours a person worked for a given day. I have used
=IF(ISERROR(O2+Q2),"-",O2+Q2) with cells O2 & Q2 being hours worked in a
block of time. Some people have a 3rd block of time in a day (column S) and
if I try =IF(ISERROR(O2+Q2+S2),"-",O2+Q2+S2) it either gives me "-" or an
error, which I know to not be an accurate result.

What am I doing wrong? Thank you!
--
heyredone
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default Using ISERROR with more than 2 cells of data

Hard to tell without knowing how you're calculating O2, Q2 & S2, but you
might want to use SUM(), since it ignores text ('+' will return the
#VALUE! error if one of the arguments is text):

=SUM(O2,Q2,S2)

and format the cell to display - if the result is 0 (e.g.,
Format/Cells/Number/Custom: General;General:"-";@


In article ,
heyredone wrote:

I have a worksheet with breakdown calculations of hours worked in a given day
for a person (morning block of time, afternoon block of time & possibly a
third block of time). I am now attempting to calculate the total number of
hours a person worked for a given day. I have used
=IF(ISERROR(O2+Q2),"-",O2+Q2) with cells O2 & Q2 being hours worked in a
block of time. Some people have a 3rd block of time in a day (column S) and
if I try =IF(ISERROR(O2+Q2+S2),"-",O2+Q2+S2) it either gives me "-" or an
error, which I know to not be an accurate result.

What am I doing wrong? Thank you!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,389
Default Using ISERROR with more than 2 cells of data

Your problem is that if any one of your cells has an error (like S2), then
you get the dash. However, in your case if S2 has an error, you still want
the total of O2 and Q2. So try it this way:
=if(iserror(s2+0),if(iserror(o2+q2),"-",o2+q2),o2+q2+s2)

However, this begs the question as to why you are creating an error when the
employee has worked zero hours. Why not enter 0 when no hours are worked?
Then you can simply sum the hours (o2+q2+s2) without needing to check for
errors.

If you want a dash displayed when the hours are zero, you're better off to
use a custom format like:
0.0;-0.0;-

This way you get the display you want, but can still do arithmetic on the
cell.

Regards,
Fred.

"heyredone" wrote in message
...
I have a worksheet with breakdown calculations of hours worked in a given
day
for a person (morning block of time, afternoon block of time & possibly a
third block of time). I am now attempting to calculate the total number
of
hours a person worked for a given day. I have used
=IF(ISERROR(O2+Q2),"-",O2+Q2) with cells O2 & Q2 being hours worked in a
block of time. Some people have a 3rd block of time in a day (column S)
and
if I try =IF(ISERROR(O2+Q2+S2),"-",O2+Q2+S2) it either gives me "-" or an
error, which I know to not be an accurate result.

What am I doing wrong? Thank you!
--
heyredone


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 24
Default Using ISERROR with more than 2 cells of data

Fred,

My apologies for the delay in responding -- had to divert to another
project. I'm back on this project now. Thank you for your response. Your
fix worked beautifully.
--
heyredone


"Fred Smith" wrote:

Your problem is that if any one of your cells has an error (like S2), then
you get the dash. However, in your case if S2 has an error, you still want
the total of O2 and Q2. So try it this way:
=if(iserror(s2+0),if(iserror(o2+q2),"-",o2+q2),o2+q2+s2)

However, this begs the question as to why you are creating an error when the
employee has worked zero hours. Why not enter 0 when no hours are worked?
Then you can simply sum the hours (o2+q2+s2) without needing to check for
errors.

If you want a dash displayed when the hours are zero, you're better off to
use a custom format like:
0.0;-0.0;-

This way you get the display you want, but can still do arithmetic on the
cell.

Regards,
Fred.

"heyredone" wrote in message
...
I have a worksheet with breakdown calculations of hours worked in a given
day
for a person (morning block of time, afternoon block of time & possibly a
third block of time). I am now attempting to calculate the total number
of
hours a person worked for a given day. I have used
=IF(ISERROR(O2+Q2),"-",O2+Q2) with cells O2 & Q2 being hours worked in a
block of time. Some people have a 3rd block of time in a day (column S)
and
if I try =IF(ISERROR(O2+Q2+S2),"-",O2+Q2+S2) it either gives me "-" or an
error, which I know to not be an accurate result.

What am I doing wrong? Thank you!
--
heyredone



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,389
Default Using ISERROR with more than 2 cells of data

Glad I could help. Thanks for the feedback.

Regards,
Fred.

"heyredone" wrote in message
...
Fred,

My apologies for the delay in responding -- had to divert to another
project. I'm back on this project now. Thank you for your response.
Your
fix worked beautifully.
--
heyredone


"Fred Smith" wrote:

Your problem is that if any one of your cells has an error (like S2),
then
you get the dash. However, in your case if S2 has an error, you still
want
the total of O2 and Q2. So try it this way:
=if(iserror(s2+0),if(iserror(o2+q2),"-",o2+q2),o2+q2+s2)

However, this begs the question as to why you are creating an error when
the
employee has worked zero hours. Why not enter 0 when no hours are worked?
Then you can simply sum the hours (o2+q2+s2) without needing to check for
errors.

If you want a dash displayed when the hours are zero, you're better off
to
use a custom format like:
0.0;-0.0;-

This way you get the display you want, but can still do arithmetic on the
cell.

Regards,
Fred.

"heyredone" wrote in message
...
I have a worksheet with breakdown calculations of hours worked in a
given
day
for a person (morning block of time, afternoon block of time & possibly
a
third block of time). I am now attempting to calculate the total
number
of
hours a person worked for a given day. I have used
=IF(ISERROR(O2+Q2),"-",O2+Q2) with cells O2 & Q2 being hours worked in
a
block of time. Some people have a 3rd block of time in a day (column S)
and
if I try =IF(ISERROR(O2+Q2+S2),"-",O2+Q2+S2) it either gives me "-" or
an
error, which I know to not be an accurate result.

What am I doing wrong? Thank you!
--
heyredone




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
Iserror help Jim Excel Discussion (Misc queries) 3 December 11th 08 09:11 PM
iserror help Scott@CW Excel Worksheet Functions 1 December 13th 07 06:03 PM
Do Not count iserror cells GoBucks Excel Discussion (Misc queries) 4 July 3rd 06 07:19 PM
ISERROR - #NAME? Mpaul Excel Worksheet Functions 2 February 20th 06 10:27 PM
iserror Walshy Excel Discussion (Misc queries) 3 December 19th 04 05:13 PM


All times are GMT +1. The time now is 01:18 AM.

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

About Us

"It's about Microsoft Excel"