#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default If & and

Hi
I have credits in c2 and debits in f2 and the running total in h2 but I do
not want h2 to display anything if there is no number in either c2 or f2. I
have an idea it should look something like this
=If (c1 and f1="","",(h1-c2+f2)) but this does not work and I am not sure
about how to tie the IF & AND functions together to achieve my objective.
Any help would be gratefully received.
Peter


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 964
Default If & and

Try this:

=IF(AND(C2="",F2=""),"",H1-C2+F2)

HTH,
Elkar


"Peter" wrote:

Hi
I have credits in c2 and debits in f2 and the running total in h2 but I do
not want h2 to display anything if there is no number in either c2 or f2. I
have an idea it should look something like this
=If (c1 and f1="","",(h1-c2+f2)) but this does not work and I am not sure
about how to tie the IF & AND functions together to achieve my objective.
Any help would be gratefully received.
Peter



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default If & and

Many thanks Elkar, Just what I needed. I have played with this for a couple
of hours and the answer looks so simple.
Regards
Peter
"Elkar" wrote in message
...
Try this:

=IF(AND(C2="",F2=""),"",H1-C2+F2)

HTH,
Elkar


"Peter" wrote:

Hi
I have credits in c2 and debits in f2 and the running total in h2 but I
do
not want h2 to display anything if there is no number in either c2 or f2.
I
have an idea it should look something like this
=If (c1 and f1="","",(h1-c2+f2)) but this does not work and I am not sure
about how to tie the IF & AND functions together to achieve my objective.
Any help would be gratefully received.
Peter





  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default If & and

"if there is no number in either c2 or f2"

I think OR function instead of AND function

=IF(OR(C2="",F2=""),"",H1-C2+F2)


"Peter" wrote:

Hi
I have credits in c2 and debits in f2 and the running total in h2 but I do
not want h2 to display anything if there is no number in either c2 or f2. I
have an idea it should look something like this
=If (c1 and f1="","",(h1-c2+f2)) but this does not work and I am not sure
about how to tie the IF & AND functions together to achieve my objective.
Any help would be gratefully received.
Peter



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default If & and

Hi, the only problem with this is that it needs entries in both c2 & f2 or
it displays nothing, and that is the thing I am trying to avoid, if there is
a number in either c2 or f2 then I want h2 to be visible. I did a bit of
playing with your idea and came up with
=IF(OR(C2<"",F2<""),H1-F2+C2,"") which works.
Many thanks for the idea, I would never have thought of doing it that way!!
Regards
Peter
"Teethless mama" wrote in message
...
"if there is no number in either c2 or f2"

I think OR function instead of AND function

=IF(OR(C2="",F2=""),"",H1-C2+F2)


"Peter" wrote:

Hi
I have credits in c2 and debits in f2 and the running total in h2 but I
do
not want h2 to display anything if there is no number in either c2 or f2.
I
have an idea it should look something like this
=If (c1 and f1="","",(h1-c2+f2)) but this does not work and I am not sure
about how to tie the IF & AND functions together to achieve my objective.
Any help would be gratefully received.
Peter





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



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