ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Urgent help with nestled condition is needed (https://www.excelbanter.com/excel-programming/307560-urgent-help-nestled-condition-needed.html)

farsta_online

Urgent help with nestled condition is needed
 
Hi, please help me with this

1) check if D6/100 1,5

2) if 1 true: check if D6/100 < 25

3) if 2 false: check D6/2501,5

4) if 3 true: check D6/250<25

5) if 4 false check D6/500 1,5

6) if 1 false: then B30= "can't use"

7) if 2 true: B16 = 100

8) B30 =(B16*60/((B2*F2)/(1*F2)))

9) If 4 true: B16 = 250

10) B30 =(B16*60/((B2*F2)/(1*F2))

11) If 5 true: B16=500

12) B30 =(B16*60/((B2*F2)/(1*F2))



Any help weŽll be appreciated

/Peter

Tom Ogilvy

Urgent help with nestled condition is needed
 
Most of this question was answered the first time you asked it although you
don't show an upper constraint for 500 this time.


=if(and(D6/1001.5,D6/100<25),100,if(And(D6/2501.5,D6/250<25),250,if(D6/250
1.5,500,"can't use")))


=if(isnumber(B16),(B16*60/((B2*F2)/(1*F2)),"can't use")


--
Regards,
Tom Ogilvy


"farsta_online" wrote in message
om...
Hi, please help me with this

1) check if D6/100 1,5

2) if 1 true: check if D6/100 < 25

3) if 2 false: check D6/2501,5

4) if 3 true: check D6/250<25

5) if 4 false check D6/500 1,5

6) if 1 false: then B30= "can't use"

7) if 2 true: B16 = 100

8) B30 =(B16*60/((B2*F2)/(1*F2)))

9) If 4 true: B16 = 250

10) B30 =(B16*60/((B2*F2)/(1*F2))

11) If 5 true: B16=500

12) B30 =(B16*60/((B2*F2)/(1*F2))



Any help weŽll be appreciated

/Peter




K Dales

Urgent help with nestled condition is needed
 
I like a challenge, so I'll give it a go:

TestVar1 = (Range("D6").Value/100)
TestVar2 = (Range("D6").Value/250)
TestVar3 = (Range("D6").Value/500)

If TestVar1 1,5 Then
If TestVar1 < 25 Then
Range("B16").Value = 100
Else
If TestVar2 1,5 Then
If TestVar2 < 25 Then
Range("B16").Value = 250
Else
If TestVar3 1,5 Then
Range("B16").Value = 500
End If
End If
End If
End If
Range("B30") = (Range("B16") * 60 / _
((Range("B2") * Range("F2")) / (1 * Range("F2"))))
Else
Range("B30").Value = "can't use"
End If

YIKES! Hope I got it...

-----Original Message-----
Hi, please help me with this

1) check if D6/100 1,5

2) if 1 true: check if D6/100 < 25

3) if 2 false: check D6/2501,5

4) if 3 true: check D6/250<25

5) if 4 false check D6/500 1,5

6) if 1 false: then B30= "can't use"

7) if 2 true: B16 = 100

8) B30 =(B16*60/((B2*F2)/(1*F2)))

9) If 4 true: B16 = 250

10) B30 =(B16*60/((B2*F2)/(1*F2))

11) If 5 true: B16=500

12) B30 =(B16*60/((B2*F2)/(1*F2))



Any help weŽll be appreciated

/Peter
.


Peter L

Urgent help with nestled condition is needed
 


Tom,
you wrote: "Most of this question was answered the first time you
asked....."
Yes but the excel (as I wrote in my answer) didnŽt accepted your
suggestion
/Peter

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Tom Ogilvy

Urgent help with nestled condition is needed
 
The formula works fine in Excel for me - and I see no post in that thread
where you responded at all. You should stay in a thread once you start
one.

--
Regards,
Tom Ogilvy

"Peter L" wrote in message
...


Tom,
you wrote: "Most of this question was answered the first time you
asked....."
Yes but the excel (as I wrote in my answer) didnŽt accepted your
suggestion
/Peter

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!




Peter L

Urgent help with nestled condition is needed
 


Tom, Iknow that I should stay in tread - but thanks anyway
/Peter

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Tom Ogilvy

Urgent help with nestled condition is needed
 
Why "thanks anyway" - the formula provided represents the situation you
described. It is taken from an excel cell (B16) where it is working very
well. If it doesn't work for you, did you change 1.5 to 1,5 so it matches
your regional settings?

--
Regards,
Tom Ogilvy

"Peter L" wrote in message
...


Tom, Iknow that I should stay in tread - but thanks anyway
/Peter

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!




Peter L

Urgent help with nestled condition is needed
 


Sorry Tom for my bad english - It wasnŽt my meaning to affend you, IŽm
very grateful for you help and support.

Anf yes I tried with both 1.5 and 1,5...
Can my truble depends on that my excel is "swedish speeking" and your
formula is in english?
/Peter

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Tom Ogilvy

Urgent help with nestled condition is needed
 
You would have to change IF and AND to the swedish equivalent.

You can try this

Sub MakeFormula()
Dim sForm as String
sForm = "=if(And(D6/1001.5,D6/100<25),100,if(And" & _
"(D6/2501.5,D6/250<25),250,if(D6/250" & _
"1.5,500,""can't use"")))"
Range("B16").Formula = sForm
End Sub

Paste that into a general module and run it.

It should put in a formula in B16 of the active sheet that your excel can
work with. You don't need to make any changes to the above - VBA should
work with the English version of the formula.

--
Regards,
Tom Ogilvy


"Peter L" wrote in message
...


Sorry Tom for my bad english - It wasnŽt my meaning to affend you, IŽm
very grateful for you help and support.

Anf yes I tried with both 1.5 and 1,5...
Can my truble depends on that my excel is "swedish speeking" and your
formula is in english?
/Peter

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!




Peter L

Urgent help with nestled condition is needed
 


Tom (and others who are reading this tread):
the problem was that "my excel" wantŽs ";" instead of ","

Thanks for al your help
/Peter

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 11:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com