#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 703
Default IF STATEMENT

I need a formula that looks at a cell and if it's not empty it preforms the
following function:
=IF(B17=B2,1,SUM(MONTH($B$2)-MONTH(B17))

B2 is set for 6/1/08, so right now if the cell is blank it returns a 5, but
I only want it to do the calculation if there's a date in the cell. How can
I add another IF statement to this to say IF(B170) then look at the above
function???
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,389
Default IF STATEMENT

You want the AND function, as in:
=IF(and(b170,B17=B2),1,MONTH($B$2)-MONTH(B17))

You don't need Sum if you're only doing arithmetic.

Regards,
Fred

"charlie" wrote in message
...
I need a formula that looks at a cell and if it's not empty it preforms the
following function:
=IF(B17=B2,1,SUM(MONTH($B$2)-MONTH(B17))

B2 is set for 6/1/08, so right now if the cell is blank it returns a 5,
but
I only want it to do the calculation if there's a date in the cell. How
can
I add another IF statement to this to say IF(B170) then look at the above
function???


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 703
Default IF STATEMENT

OK, I did that, but if the cell is blank it's still returning a 5, but I want
it to return a zero.

"Fred Smith" wrote:

You want the AND function, as in:
=IF(and(b170,B17=B2),1,MONTH($B$2)-MONTH(B17))

You don't need Sum if you're only doing arithmetic.

Regards,
Fred

"charlie" wrote in message
...
I need a formula that looks at a cell and if it's not empty it preforms the
following function:
=IF(B17=B2,1,SUM(MONTH($B$2)-MONTH(B17))

B2 is set for 6/1/08, so right now if the cell is blank it returns a 5,
but
I only want it to do the calculation if there's a date in the cell. How
can
I add another IF statement to this to say IF(B170) then look at the above
function???



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 913
Default IF STATEMENT

On Thu, 10 Jul 2008 12:34:15 -0700, charlie
wrote:

I need a formula that looks at a cell and if it's not empty it preforms the
following function:
=IF(B17=B2,1,SUM(MONTH($B$2)-MONTH(B17))

B2 is set for 6/1/08, so right now if the cell is blank it returns a 5, but
I only want it to do the calculation if there's a date in the cell. How can
I add another IF statement to this to say IF(B170) then look at the above
function???


Try this:

=IF(ISBLANK(B17), "" , your original formula goes here )

that is

=IF(ISBLANK(B17), "" , IF(B17=B2, 1, MONTH($B$2)-MONTH(B17) )

Hope this helps / Lars-Åke
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 209
Default IF STATEMENT

Charlie,
You lost the Month( ) function AND testing if different years from
previous posts.
--
Hope this helps.
If this post was helpfull, please remember to click on the ''''YES''''
button at the bottom of the screen.
Thanks,
Gary Brown


"charlie" wrote:

OK, I did that, but if the cell is blank it's still returning a 5, but I want
it to return a zero.

"Fred Smith" wrote:

You want the AND function, as in:
=IF(and(b170,B17=B2),1,MONTH($B$2)-MONTH(B17))

You don't need Sum if you're only doing arithmetic.

Regards,
Fred

"charlie" wrote in message
...
I need a formula that looks at a cell and if it's not empty it preforms the
following function:
=IF(B17=B2,1,SUM(MONTH($B$2)-MONTH(B17))

B2 is set for 6/1/08, so right now if the cell is blank it returns a 5,
but
I only want it to do the calculation if there's a date in the cell. How
can
I add another IF statement to this to say IF(B170) then look at the above
function???





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 703
Default IF STATEMENT

I don't know what you mean...

"Gary Brown" wrote:

Charlie,
You lost the Month( ) function AND testing if different years from
previous posts.
--
Hope this helps.
If this post was helpfull, please remember to click on the ''''YES''''
button at the bottom of the screen.
Thanks,
Gary Brown


"charlie" wrote:

OK, I did that, but if the cell is blank it's still returning a 5, but I want
it to return a zero.

"Fred Smith" wrote:

You want the AND function, as in:
=IF(and(b170,B17=B2),1,MONTH($B$2)-MONTH(B17))

You don't need Sum if you're only doing arithmetic.

Regards,
Fred

"charlie" wrote in message
...
I need a formula that looks at a cell and if it's not empty it preforms the
following function:
=IF(B17=B2,1,SUM(MONTH($B$2)-MONTH(B17))

B2 is set for 6/1/08, so right now if the cell is blank it returns a 5,
but
I only want it to do the calculation if there's a date in the cell. How
can
I add another IF statement to this to say IF(B170) then look at the above
function???


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 703
Default IF STATEMENT

THAT'S IT!!! Thanks so much!!!!!!!

"Lars-Ã…ke Aspelin" wrote:

On Thu, 10 Jul 2008 12:34:15 -0700, charlie
wrote:

I need a formula that looks at a cell and if it's not empty it preforms the
following function:
=IF(B17=B2,1,SUM(MONTH($B$2)-MONTH(B17))

B2 is set for 6/1/08, so right now if the cell is blank it returns a 5, but
I only want it to do the calculation if there's a date in the cell. How can
I add another IF statement to this to say IF(B170) then look at the above
function???


Try this:

=IF(ISBLANK(B17), "" , your original formula goes here )

that is

=IF(ISBLANK(B17), "" , IF(B17=B2, 1, MONTH($B$2)-MONTH(B17) )

Hope this helps / Lars-Ã…ke

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
Can an If statement answer an If statement? M.A.Tyler Excel Discussion (Misc queries) 2 June 24th 07 04:14 AM
if/then statement PoolPool Excel Discussion (Misc queries) 2 February 7th 07 07:52 PM
appending and IF statement to an existing IF statement spence Excel Worksheet Functions 1 February 28th 06 11:00 PM
If statement and Isblank statement Rodney C. Excel Worksheet Functions 0 January 18th 05 08:39 PM
Help please, IF statement/SUMIF statement Brad_A Excel Worksheet Functions 23 January 11th 05 02:24 PM


All times are GMT +1. The time now is 05:16 PM.

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"