Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
Is it possible to constuct a 16 constraint nested if then statement using one equation as the control equation? Is there a better way to do this? Please advise... Regards, Fish |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How about the Select Case?
Sub CaseTest() Select Case Range("A1").Value Case 1 MsgBox "1" Case 2 MsgBox "2" Case Else MsgBox "Not 1 or 2" End Select End Sub Change the Cases as needed Charles Fish wrote: Hello, Is it possible to constuct a 16 constraint nested if then statement using one equation as the control equation? Is there a better way to do this? Please advise... Regards, Fish |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
more info and a sample would be helpful
-- Don Guillett SalesAid Software "Fish" wrote in message ... Hello, Is it possible to constuct a 16 constraint nested if then statement using one equation as the control equation? Is there a better way to do this? Please advise... Regards, Fish |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is my sample equation:
=IF(M2=N2,IF(P2=0,((R2-(R2*0.35)-M2)/R2),((P2-(P2*0.35)-M2)/P2)),IF(N2=0,((R2-(R2*0.35)-M2)/R2),"FALSE")) There are four colums of data and a total of 16 differnet combinations based on statistics. These are not the actual numbers but here are all of the combinations: M N O P 1 0 1 1 0 0 0 1 0 0 1 1 0 1 1 1 1 1 1 1 1 0 0 0 1 1 0 0 1 1 1 0 0 1 0 0 0 0 1 0 0 1 1 0 1 1 0 1 1 0 0 1 0 0 0 0 0 1 0 1 1 0 1 0 Here are the constrainsts: 1. If M=N compute the equation 2. If M is unequal to N give a value of false 3. If a value exist for O and P use the value for O 4. If a value of zero is used for the O colums use the value for P to compute the equation. I hope this helps. Thanks for your assistance, Fish "Don Guillett" wrote: more info and a sample would be helpful -- Don Guillett SalesAid Software "Fish" wrote in message ... Hello, Is it possible to constuct a 16 constraint nested if then statement using one equation as the control equation? Is there a better way to do this? Please advise... Regards, Fish |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Please note P=R
"Fish" wrote: Here is my sample equation: =IF(M2=N2,IF(P2=0,((R2-(R2*0.35)-M2)/R2),((P2-(P2*0.35)-M2)/P2)),IF(N2=0,((R2-(R2*0.35)-M2)/R2),"FALSE")) There are four colums of data and a total of 16 differnet combinations based on statistics. These are not the actual numbers but here are all of the combinations: M N O P 1 0 1 1 0 0 0 1 0 0 1 1 0 1 1 1 1 1 1 1 1 0 0 0 1 1 0 0 1 1 1 0 0 1 0 0 0 0 1 0 0 1 1 0 1 1 0 1 1 0 0 1 0 0 0 0 0 1 0 1 1 0 1 0 Here are the constrainsts: 1. If M=N compute the equation 2. If M is unequal to N give a value of false 3. If a value exist for O and P use the value for O 4. If a value of zero is used for the O colums use the value for P to compute the equation. I hope this helps. Thanks for your assistance, Fish "Don Guillett" wrote: more info and a sample would be helpful -- Don Guillett SalesAid Software "Fish" wrote in message ... Hello, Is it possible to constuct a 16 constraint nested if then statement using one equation as the control equation? Is there a better way to do this? Please advise... Regards, Fish |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I thought you could only nest 7 if Statements, so I am with the Select Case too. -- David "Fish" wrote: Hello, Is it possible to constuct a 16 constraint nested if then statement using one equation as the control equation? Is there a better way to do this? Please advise... Regards, Fish |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Actually there are many ways around the 7 nested limit. One is nest 7 + nest
7 -- Don Guillett SalesAid Software "David" wrote in message ... Hi, I thought you could only nest 7 if Statements, so I am with the Select Case too. -- David "Fish" wrote: Hello, Is it possible to constuct a 16 constraint nested if then statement using one equation as the control equation? Is there a better way to do this? Please advise... Regards, Fish |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Solver Ignores Constraints | Excel Discussion (Misc queries) | |||
Solver Constraints | Excel Discussion (Misc queries) | |||
constraints | Excel Worksheet Functions | |||
Equation Editor- problem when editing an equation | Excel Discussion (Misc queries) | |||
Solver Constraints | Excel Discussion (Misc queries) |