Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 184
Default nested if statements

Here's the situation: I'm trying to return a specific value to the cell based
on conditions in 4 cells in the same row. If A is valid (in this case1966),
then I want to check B to see if that has a valid value (also 1966). If both
these conditions are true, then I want to check to see whether A and B agree.
If all 3 things are true, then I want to see a value of 1. If the first 2 are
true (A and B are both valid) but the 3rd is not (A is not equal to B), then
the value in the cell should be equal to (A-B)+1.

If the first condition is true (A 1966), but the 2nd is not, I want to
return a value of 1.

If the first condition (A1966) is false, then I want to check B for a
valid value (1966). If B is valid, then I want to return a value of 1. If
not, then I want to check C for validity. If C is valid (1966), then I want
to return a value of C-D. If it is not, then I'd like to return a value of
2007-D.

This is the formula I use:

IF(A11966,if(b11966,if(a1=b1,1(a1-b1+1),1,IF(B11966,1,IF(C11966,(C1-D1)+1,2007-D1)))

I get "The formula you typed contains an error". I can't figure out the error.

Any help will be greatly appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
lk lk is offline
external usenet poster
 
Posts: 39
Default nested if statements

I think it is this part that is causing your problem:

if(a1=b1,1(a1-b1+1)

maybe you need a comma between the first "1" and the (a1-b1+1)

"Jeremy" wrote:

Here's the situation: I'm trying to return a specific value to the cell based
on conditions in 4 cells in the same row. If A is valid (in this case1966),
then I want to check B to see if that has a valid value (also 1966). If both
these conditions are true, then I want to check to see whether A and B agree.
If all 3 things are true, then I want to see a value of 1. If the first 2 are
true (A and B are both valid) but the 3rd is not (A is not equal to B), then
the value in the cell should be equal to (A-B)+1.

If the first condition is true (A 1966), but the 2nd is not, I want to
return a value of 1.

If the first condition (A1966) is false, then I want to check B for a
valid value (1966). If B is valid, then I want to return a value of 1. If
not, then I want to check C for validity. If C is valid (1966), then I want
to return a value of C-D. If it is not, then I'd like to return a value of
2007-D.

This is the formula I use:

IF(A11966,if(b11966,if(a1=b1,1(a1-b1+1),1,IF(B11966,1,IF(C11966,(C1-D1)+1,2007-D1)))

I get "The formula you typed contains an error". I can't figure out the error.

Any help will be greatly appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bj bj is offline
external usenet poster
 
Posts: 1,397
Default nested if statements

IF(A11966,if(b11966,if(a1=b1,1(a1-b1+1),1,IF(B11966,1,IF(C11966,(C1-D1)+1,2007-D1)))

IF(and(A11966,B11966),if(a1=b1,1,a1-b1+1),IF(and(A1<=1966,B11966),1,IF(C11966,C1-D1,2007-D1)))





"Jeremy" wrote:

Here's the situation: I'm trying to return a specific value to the cell based
on conditions in 4 cells in the same row. If A is valid (in this case1966),
then I want to check B to see if that has a valid value (also 1966). If both
these conditions are true, then I want to check to see whether A and B agree.
If all 3 things are true, then I want to see a value of 1. If the first 2 are
true (A and B are both valid) but the 3rd is not (A is not equal to B), then
the value in the cell should be equal to (A-B)+1.

If the first condition is true (A 1966), but the 2nd is not, I want to
return a value of 1.

If the first condition (A1966) is false, then I want to check B for a
valid value (1966). If B is valid, then I want to return a value of 1. If
not, then I want to check C for validity. If C is valid (1966), then I want
to return a value of C-D. If it is not, then I'd like to return a value of
2007-D.

This is the formula I use:

IF(A11966,if(b11966,if(a1=b1,1(a1-b1+1),1,IF(B11966,1,IF(C11966,(C1-D1)+1,2007-D1)))

I get "The formula you typed contains an error". I can't figure out the error.

Any help will be greatly appreciated.

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
Returning text from nested IF and Vlookup statements Patricia Excel Worksheet Functions 10 July 28th 06 04:22 PM
Nested If Statements Jasmine Excel Worksheet Functions 2 January 26th 06 03:47 PM
UDFunctions and nested If-the-else statements JDB Excel Worksheet Functions 1 January 25th 06 03:29 PM
multiple nested IF statements jazzydwit Excel Worksheet Functions 4 December 29th 05 05:23 PM
Nested IF statements John Simons Excel Worksheet Functions 14 February 16th 05 06:17 AM


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