Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Metallo
 
Posts: n/a
Default How can improve this formula?

Hi,

I have a WB, with 3 WSs in it.
Let's call them, A,B,C

The numbers in C are given by A - B
=IF(ISERROR('A-'B),0,'A-B)

The problem is that if I have no data in B then I get A numbers into C

How can I add a third condition to the formula so that when no data are
present in B then it should show Nothing in C?

Thank you!
Alex
  #2   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi

P.e. with formula on row 2
=IF(B2="","",(B2<"")*SUM(A2,-B2))

--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets


"Metallo" wrote in message
...
Hi,

I have a WB, with 3 WSs in it.
Let's call them, A,B,C

The numbers in C are given by A - B
=IF(ISERROR('A-'B),0,'A-B)

The problem is that if I have no data in B then I get A numbers into C

How can I add a third condition to the formula so that when no data are
present in B then it should show Nothing in C?

Thank you!
Alex



  #3   Report Post  
Metallo
 
Posts: n/a
Default

Hi Arvi,

Could you please explain abit the formula?

This is what I have as a real example:

=IF(ISERROR('2003'!G9-'2005 Comp to 2003'!G9),0,'2003'!G9-'2005 Comp to
2003'!G9)

I should I change this it?

Thank you
Alex

"Arvi Laanemets" wrote:

Hi

P.e. with formula on row 2
=IF(B2="","",(B2<"")*SUM(A2,-B2))

--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets


"Metallo" wrote in message
...
Hi,

I have a WB, with 3 WSs in it.
Let's call them, A,B,C

The numbers in C are given by A - B
=IF(ISERROR('A-'B),0,'A-B)

The problem is that if I have no data in B then I get A numbers into C

How can I add a third condition to the formula so that when no data are
present in B then it should show Nothing in C?

Thank you!
Alex




  #4   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi

=IF('2003'!G9="","",('2005 Comp to 2003'!G9<"")*SUM('2003'!G9,-'2005 Comp
to 2003'!G9))

(there was an error in previous formula, it had to be
'=IF(A2="","",(B2<"")*SUM(A2,-B2))')

What does the formula do?

IF('2003'!G9="","",...) checks the cell G9 on sheet 2003, and when this is
empty, nothing is returned. In case you wanted nothing to be returned with
cell G9 on either sheet 2003 or sheet '2005 ...' , the formula would be:
=IF(OR('2003'!G9="",'2005 Comp to 2003'!G9=""),"",SUM('2003'!G9,-'2005 Comp
to 2003'!G9))

You wanted the formula to return 0, when cell G9 on sheet '2005 ...' is
empty. The ('2005 Comp to 2003'!G9<"") part returns TRUE or FALSE - which
in Excel are interpreted as 1 or 0 , when multiplied with (or added to)
numeric values. So whatever value the SUM returns, when there is no entry in
cell G9, this value is multiplied with 0, and 0 is returned. Otherwise the
sum is multiplied with 1, and the sum is returned.

Now the last part of formula. You used ISERROR to check for empty cells,
because mathematical operators don't work with empty cells or with cells
containing strings. But SUM function simply ignores such cells. So when cell
'2005 Comp to 2003'!G9 is empty (or contains p.e. word "empty"), only cell
'2003'!G9 is summed. No errors anymore.


--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets



"Metallo" wrote in message
...
Hi Arvi,

Could you please explain abit the formula?

This is what I have as a real example:

=IF(ISERROR('2003'!G9-'2005 Comp to 2003'!G9),0,'2003'!G9-'2005 Comp to
2003'!G9)

I should I change this it?

Thank you
Alex

"Arvi Laanemets" wrote:

Hi

P.e. with formula on row 2
=IF(B2="","",(B2<"")*SUM(A2,-B2))

--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets


"Metallo" wrote in message
...
Hi,

I have a WB, with 3 WSs in it.
Let's call them, A,B,C

The numbers in C are given by A - B
=IF(ISERROR('A-'B),0,'A-B)

The problem is that if I have no data in B then I get A numbers into C

How can I add a third condition to the formula so that when no data

are
present in B then it should show Nothing in C?

Thank you!
Alex






  #5   Report Post  
Metallo
 
Posts: n/a
Default

Arvi,

I tried both the formulas, but they still return the value which is in
'2003'!G9, while I would expect nothing (0).

Can you re-check it?

Thank you
Alex

"Arvi Laanemets" wrote:

Hi

=IF('2003'!G9="","",('2005 Comp to 2003'!G9<"")*SUM('2003'!G9,-'2005 Comp
to 2003'!G9))

(there was an error in previous formula, it had to be
'=IF(A2="","",(B2<"")*SUM(A2,-B2))')

What does the formula do?

IF('2003'!G9="","",...) checks the cell G9 on sheet 2003, and when this is
empty, nothing is returned. In case you wanted nothing to be returned with
cell G9 on either sheet 2003 or sheet '2005 ...' , the formula would be:
=IF(OR('2003'!G9="",'2005 Comp to 2003'!G9=""),"",SUM('2003'!G9,-'2005 Comp
to 2003'!G9))

You wanted the formula to return 0, when cell G9 on sheet '2005 ...' is
empty. The ('2005 Comp to 2003'!G9<"") part returns TRUE or FALSE - which
in Excel are interpreted as 1 or 0 , when multiplied with (or added to)
numeric values. So whatever value the SUM returns, when there is no entry in
cell G9, this value is multiplied with 0, and 0 is returned. Otherwise the
sum is multiplied with 1, and the sum is returned.

Now the last part of formula. You used ISERROR to check for empty cells,
because mathematical operators don't work with empty cells or with cells
containing strings. But SUM function simply ignores such cells. So when cell
'2005 Comp to 2003'!G9 is empty (or contains p.e. word "empty"), only cell
'2003'!G9 is summed. No errors anymore.


--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets



"Metallo" wrote in message
...
Hi Arvi,

Could you please explain abit the formula?

This is what I have as a real example:

=IF(ISERROR('2003'!G9-'2005 Comp to 2003'!G9),0,'2003'!G9-'2005 Comp to
2003'!G9)

I should I change this it?

Thank you
Alex

"Arvi Laanemets" wrote:

Hi

P.e. with formula on row 2
=IF(B2="","",(B2<"")*SUM(A2,-B2))

--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets


"Metallo" wrote in message
...
Hi,

I have a WB, with 3 WSs in it.
Let's call them, A,B,C

The numbers in C are given by A - B
=IF(ISERROR('A-'B),0,'A-B)

The problem is that if I have no data in B then I get A numbers into C

How can I add a third condition to the formula so that when no data

are
present in B then it should show Nothing in C?

Thank you!
Alex








  #6   Report Post  
Metallo
 
Posts: n/a
Default

Arvi,

Probably I omitted an important information, '2005 Comp to 2003'!G9 is empty
in terms that there is no value in it, but that cell contains a formula which
is supposed to return a value in case a number in input in another Sheet.
Could this be the reason?

Thank you
Alex

"Metallo" wrote:

Arvi,

I tried both the formulas, but they still return the value which is in
'2003'!G9, while I would expect nothing (0).

Can you re-check it?

Thank you
Alex

"Arvi Laanemets" wrote:

Hi

=IF('2003'!G9="","",('2005 Comp to 2003'!G9<"")*SUM('2003'!G9,-'2005 Comp
to 2003'!G9))

(there was an error in previous formula, it had to be
'=IF(A2="","",(B2<"")*SUM(A2,-B2))')

What does the formula do?

IF('2003'!G9="","",...) checks the cell G9 on sheet 2003, and when this is
empty, nothing is returned. In case you wanted nothing to be returned with
cell G9 on either sheet 2003 or sheet '2005 ...' , the formula would be:
=IF(OR('2003'!G9="",'2005 Comp to 2003'!G9=""),"",SUM('2003'!G9,-'2005 Comp
to 2003'!G9))

You wanted the formula to return 0, when cell G9 on sheet '2005 ...' is
empty. The ('2005 Comp to 2003'!G9<"") part returns TRUE or FALSE - which
in Excel are interpreted as 1 or 0 , when multiplied with (or added to)
numeric values. So whatever value the SUM returns, when there is no entry in
cell G9, this value is multiplied with 0, and 0 is returned. Otherwise the
sum is multiplied with 1, and the sum is returned.

Now the last part of formula. You used ISERROR to check for empty cells,
because mathematical operators don't work with empty cells or with cells
containing strings. But SUM function simply ignores such cells. So when cell
'2005 Comp to 2003'!G9 is empty (or contains p.e. word "empty"), only cell
'2003'!G9 is summed. No errors anymore.


--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets



"Metallo" wrote in message
...
Hi Arvi,

Could you please explain abit the formula?

This is what I have as a real example:

=IF(ISERROR('2003'!G9-'2005 Comp to 2003'!G9),0,'2003'!G9-'2005 Comp to
2003'!G9)

I should I change this it?

Thank you
Alex

"Arvi Laanemets" wrote:

Hi

P.e. with formula on row 2
=IF(B2="","",(B2<"")*SUM(A2,-B2))

--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets


"Metallo" wrote in message
...
Hi,

I have a WB, with 3 WSs in it.
Let's call them, A,B,C

The numbers in C are given by A - B
=IF(ISERROR('A-'B),0,'A-B)

The problem is that if I have no data in B then I get A numbers into C

How can I add a third condition to the formula so that when no data

are
present in B then it should show Nothing in C?

Thank you!
Alex






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
revert formula insertion to old method Don't be a pain in the ass Setting up and Configuration of Excel 0 January 24th 05 01:49 PM
Relative Indirect Formula Referencing? Damian Excel Worksheet Functions 1 January 7th 05 04:16 AM
Help with macro formula and variable Huge project Excel Worksheet Functions 0 December 28th 04 01:27 AM
Need to improve a formula Brian Excel Worksheet Functions 2 December 9th 04 07:17 PM
Cell doesn't show formula result - it shows formula (CTRL + ' doe. o0o0o0o Excel Worksheet Functions 6 November 19th 04 03:13 PM


All times are GMT +1. The time now is 07:48 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"