Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What
is max condition can u have in an If...Else Statement. I have four conditions. How do I apply the if...else statement on this conditions? As what I know and have tried, in an if..else statement, we can only have one "else if" and one "else" within the structure. I hope I'm not being confusing. I have include the code: ================================================== === If txtDmdPeak.Text <= txtDtotal.Text Then 'Firm - Normal Bill If Answer = True Then If txtCalculatedDemand.Text < txtDsbf.Text Then txtFirmStandbyCharge.Text = (txtDsbf.Value - txtCalculatedDemand.Value) * txtMaxDmcFirm.Value If txtFirmStandbyCharge.Value = "" Then txtFirmStandbyCharge.Value = "0" Else txtFirmStandbyCharge.Value = Format (txtFirmStandbyCharge.Value, "######.##") End If End If If txtDsbf.Text < txtCalculatedDemand.Text Then If txtCalculatedDemand.Text < txtDtotal.Text Then txtFirmStandbyCharge.Text = (txtDtotal.Value - txtCalculatedDemand.Value) * txtMaxDmcNonFirm.Value If txtFirmStandbyCharge.Text = "" Then txtFirmStandbyCharge.Text = "0" Else txtFirmStandbyCharge.Value = Format (txtFirmStandbyCharge.Value, "######.##") End If End If End If ================================================== ======== I have posted this question earlier but there wasn't any reply to this. The only advise was replied to me was that I should replace the inner if to else if. But again, pls verify the statement that I made in my first & second paragraph. Thank you very much in advance for your help. Sheela |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
If statement in excel | Excel Discussion (Misc queries) | |||
IF statement inside a SUMIF statement.... or alternative method | Excel Worksheet Functions | |||
Reconcile Bank statement & Credit card statement & accounting data | Excel Worksheet Functions | |||
Embedding an OR statement in an IF statement efficiently | Excel Discussion (Misc queries) | |||
appending and IF statement to an existing IF statement | Excel Worksheet Functions |