Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default if then statement with 16 constraints and 1 equation

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default if then statement with 16 constraints and 1 equation

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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default if then statement with 16 constraints and 1 equation

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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default if then statement with 16 constraints and 1 equation

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


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default if then statement with 16 constraints and 1 equation

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






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default if then statement with 16 constraints and 1 equation

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





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default if then statement with 16 constraints and 1 equation

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





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
Solver Ignores Constraints Jerry W. Lewis Excel Discussion (Misc queries) 1 November 17th 07 04:30 AM
Solver Constraints twa14 Excel Discussion (Misc queries) 2 October 13th 07 01:10 PM
constraints steve Excel Worksheet Functions 0 January 5th 06 08:38 PM
Equation Editor- problem when editing an equation Gaby L. Excel Discussion (Misc queries) 0 September 27th 05 09:24 PM
Solver Constraints Rick Excel Discussion (Misc queries) 15 March 9th 05 03:17 PM


All times are GMT +1. The time now is 04:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"