Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can an If statement answer an If statement? | Excel Discussion (Misc queries) | |||
if/then statement | Excel Discussion (Misc queries) | |||
appending and IF statement to an existing IF statement | Excel Worksheet Functions | |||
If statement and Isblank statement | Excel Worksheet Functions | |||
Help please, IF statement/SUMIF statement | Excel Worksheet Functions |