If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > FileMaker > nested if

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-07-04, 22:04
poopsie poopsie is offline
Registered User
 
Join Date: Dec 2004
Posts: 1
nested if

I'm trying to set upTerm 1 for my school.

Projects is worth 30%, Homework is worth 30%, Attitude is worth 10%, and Exams are worth 30%........I'd like to keep a running average. The first 4 lnes here below work fine, but (5th line) when I try to calculate the average when 2 of the 4 fields are empy, it won't work......Please take a look at the "mess below" (from the 5th line onward) and see where I went wrong.

Thank you for you time and expertise
Drew



If( IsEmpty(Projects 1), Sum(Homework 1,Attitude 1,Exams 1)/.70,
If( IsEmpty(Homework 1), Sum(Projects 1,Attitude 1,Exams 1)/.70,
If( IsEmpty(Attitude 1), Sum(Projects 1,Homework 1,Exams 1)/.90,
If( IsEmpty(Exams 1), Sum(Projects 1,Homework 1,Attitude 1)/.70,
If( IsEmpty( Projects 1) & IsEmpty(Homework 1), Sum(Attitude 1,Exams 1)/.40,
If( IsEmpty(Projects 1) & IsEmpty(Attitude 1), Sum(Homework 1,Exams 1)/.60,
If( IsEmpty(Projects 1) & IsEmpty( Exams 1) , Sum(Homework 1,Attitude 1)/.40,
If( IsEmpty( Homework 1) & IsEmpty( Attitude 1), Sum(Projects 1,Exams 1)/.60,
If( IsEmpty( Homework 1) & IsEmpty(Exams 1), Sum(Projects 1,Attitude 1)/.40,
If( IsEmpty(Attitude 1) & IsEmpty(Exams 1), Sum(Projects 1,Homework 1)/.60,
If( IsEmpty(Projects 1) & IsEmpty(Homework 1) & IsEmpty( Attitude 1), Sum(Exams 1)/.30,
If( IsEmpty(Homework 1) & IsEmpty(Attitude 1) & IsEmpty(Exams 1), Sum(Projects 1)/.30,
If( IsEmpty(Attitude 1) & IsEmpty(Exams 1) & IsEmpty(Projects 1) , Sum(Homework 1)/.30,
If( IsEmpty( Exams 1) & IsEmpty(Projects 1) & IsEmpty(Homework 1), Sum(Attitude 1)/.10,
Sum( Projects 1,Homework 1,Attitude 1,Exams 1)))))))))))))))
Reply With Quote
  #2 (permalink)  
Old 12-21-04, 07:10
CobaltSky CobaltSky is offline
Registered User
 
Join Date: May 2004
Location: Melbourne, Australia
Posts: 23
Hi,
Two things. Firstly, you woudl be better off using the Case( ) function for this, as it is specifically designed to haldle a series of tests and results within a single function call (no need for nesting).

Secondly, you should bear in mind that the expressions will be evaluated stricly in the order that they are presented, so the first result that is valid will be returned.
__________________
-------------------
Ray
FileMaker Developer
http://www.nightwing.com.au/FileMaker
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On