Please Help with IIF Statement

wangnild

New member
Local time
Today, 03:36
Joined
Dec 5, 2006
Messages
3
I currently have an IIF Statement that looks like this:

City Energy: IIf([Tbl-Input Data]![Billing Month]<=37560,[WAPA Net]-([Med Bow 8]+[Med Bow 9])*[City Loss]+[City Energy Adj],[WAPA Out]-([Med Bow 8]*[City Loss])-[Clipper Energy]+[City Energy Adj])


Now I need to add after October 31, 2006, follow this equation: [WAPA Out]-([Med Bow 8]*[City Loss])-[Clipper Energy]+[City Energy Adj]). Where would I put it in the above IIF statement?

Thanks in advance.

Melissa
 
Well, 37560 represents 10/31/2002, so, I'm guessing that since the FALSE part of your equation matches what you want to be followed, I am guessing that what you want to do is replace the 37560 with "#10/31/06#" (remove the quotes) because right now it is following that logic for dates after 10/31/06 (and between 11/01/02 and 10/31/06 ...)

City Energy: IIf([Tbl-Input Data]![Billing Month]<=#10/31/06#,[WAPA Net]-([Med Bow 8]+[Med Bow 9])*[City Loss]+[City Energy Adj],[WAPA Out]-([Med Bow 8]*[City Loss])-[Clipper Energy]+[City Energy Adj])
 
Well I have 3 different equations for 3 different time periods.

Before 10/31/02, I want to use this equation:

[WAPA Net]-([Med Bow 8]+[Med Bow 9])*[City Loss]+[City Energy Adj]

Between 11/01/02 and 10/31/06, I want to use this equation:

[WAPA Out]-([Med Bow 8]*[City Loss])-[Clipper Energy]+[City Energy Adj])

And beginning 11/01/06, I want to use this equation:

[WAPA Net]-([Med Bow 8]*[City Loss])-[Clipper Energy]+[City Energy Adj])

I’m not sure how to combine these three statements into 1 IFF statement. If you’re wondering, this is for billing wind energy to our municipalities.

Thanks. Melissa
 
In your original post, you only had two distinct equations (showed 3, but two were the same)

I'll abbreviate the equation to make it more readable:

A: [WAPA Net]-([Med Bow 8]+[Med Bow 9])*[City Loss]+[City Energy Adj]
B: [WAPA Out]-([Med Bow 8]*[City Loss])-[Clipper Energy]+[City Energy Adj]
C: [WAPA Net]-([Med Bow 8]*[City Loss])-[Clipper Energy]+[City Energy Adj]

IIF([Tbl-Input Data]![Billing Month]<=#10/31/02#,A,IIF([Tbl-Input Data]![Billing Month]>#10/31/06#, C, B))
 
You're right. I did put the wrong equations in my original post. Sorry for the confusion. :)

Anyways, I tried your suggestion and it worked! :)

Thank you so much for your help. You saved me a lot of time of aggregation and confusion.

Thanks again.

Melissa
 

Users who are viewing this thread

Back
Top Bottom