#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 747
Default embedded ifs

The formula got reconstructed somehow when you pasted. Following is the
result of direct substitution of TC with P95 and AC with P96. I believe you
also want to substitute the J98:J101 values in place of the hard numbers.
I'll leave that to you. I suggest you test the formula before pasting the
J98:J101 values.

=If(P96 <= P95, P96 * 0.442, If(P96 <= P95 + 100, P95 * 0.442 + (P96 - P95)
* 1.327, If(P96 <= P95 + 1500, P95 * 0.442 + 100 * 1.327 + (P96 - P95 - 100)
* 1.098, P95 * 0.442 + 100 * 1.327 + 1400 * 1.098 + (P96 - P95 - 1500) *
0.9255)))

Regards,
Greg

"Daniel Q." wrote:

Greg - thank you very much for your help so far. My mind keeps juggling old
C++ syntax (if..., then...)

Your assumption on P95 being theoretical consumption is correct.

Seeing your formula makes sense. I've followed the IF logic but i think i'm
missing some parentheses somewhere.

I replaced actual consumption(AC) with P96 and theoretical (TC) with P95

This is what i copied into the cell:

=IF(P96<=P95,P96*0.442,(IF(P96<=P95+100,P95*0.442+ (P96-P95)*1.327),(IF(P96<=P95+1500,P95*.442+100*1.327+( P96-P95-100)*1.098),P95*.442+100*1.327+1400*1.098+(P96-P95-1500)*.9225)))

DQ

"Greg Wilson" wrote:

Daniel,

I probably don't have my interpretation right but this is at least a stab at
it. This seems to comply with your verbal description (more or less) but
contrasts with your formula. Hopefully this will at least serve as a good
start.

Interpretation:-

Cells J98:J101 contain the constant values as follows:
J98 = 0.442
J99 = 1.327
J100 = 1.098
J101 = 0.9255

- Cell P94 contains any given date (June 06 in your example)
- Cell P95 calculates the theoretical monthly consumption (TC) by
calculating how many days are in the month specified in P94 and multiplying
by the average daily unit volume of 677.3 (or just calculates the number of
days in the month ???)
- Cell P96 contains the actual monthly consumption (AC)
- Cell P97 contains the formula

Logic foundation is as follows:

If AC<=TC then: AC * 0.442
ElseIf AC<=TC + 100 then: TC * 0.442 + (AC - TC) * 1.327
ElseIf AC<=TC + 1500 then: TC * 0.442 + 100 * 1.327 + (AC - TC - 100) *
1.098
ElseIF ACTC + 1500 then: TC * 0.442 + 100 * 1.327 + 1400 * 1.098 + (AC -
TC - 1500) * 0.9255

whe-
TC = Theoretical Consumption (or P95 value ???)
AC = Actual Consumption or P96 value

Suggested formula:

=If(AC <= TC, AC * 0.442, If(AC <= TC + 100, TC * 0.442 + (AC - TC) * 1.327,
If(AC <= TC + 1500, TC * 0.442 + 100 * 1.327 + (AC - TC - 100) * 1.098, TC *
0.442 + 100 * 1.327 + 1400 * 1.098 + (AC - TC - 1500) * 0.9255)))
The formula requires substitutions for AC and TC and the J98:J101 cell
references in place of the hard numbers in the formula. This all should be
easy. Sorting out what you want is the challenge. *The formula was written in
a hurry and is not tested*.

Again, I know this is very likely wrong but hope the comparison will help
illuminate. In particular, I don't know if P95 contains the theoretical
consumption (days in month x 677.3 or just the days in the month). You also
appear to be wanting to illiminate refering to the value in P95 but coding
its contents into the formula instead. If so, it should be an easy copy/paste
into the formula once this is clarified. You might also want to consider
going with named ranges in place of cell references so that you can actually
use AC and TC in your formula.

I have to go out for several hours and won't be able to respond until this
evening.

Regards,
Greg


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
Links in Embedded doc within sheet don't change when sheet is copi Dan k Excel Discussion (Misc queries) 0 May 11th 06 05:41 PM
Deactivating an embedded chart TheRobsterUK Excel Discussion (Misc queries) 0 October 3rd 05 01:30 AM
Hide embedded objects contained in row that is filtered out Jim2003 Excel Discussion (Misc queries) 1 July 13th 05 05:31 PM
Displaying cell references next to embedded cells in Word 2000 The Consigliere New Users to Excel 1 April 9th 05 02:58 PM
problem with embedded pdf file Gary Excel Discussion (Misc queries) 0 January 19th 05 01:57 PM


All times are GMT +1. The time now is 05:46 PM.

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"