See the top rated post in this thread. Click here

Results 1 to 9 of 9

Thread: Calculated Value

  1. #1
    Member
    Join Date
    2006-05
    Posts
    10
    Login to Give a bone
    0

    Default Calculated Value

    I have an average mixed use parking calculation which I'd like to complete out of the area plan I've created.

    Using just two parameters "Name" and "Area" I'm attempting to create a calculated value like so, IF (Name = OFFICE, Area / 300, IF (Name = AUDITORIUM, Area = 77, 0))... But it errors out at OFFICE even though this is a valid name for an area.

    Second attempt IF(Area = 18585 SF, Area / 300 SF, IF(Area = 8205 SF, 77, 0)) The two square footages are for the OFFICE and AUDITORIUM, which are all I was trying to capture at this point. This formula results in every calc value coming out to 0, switch it to a 1 in the formula and you get a 1.

    Some help would be awesome.

  2. #2
    AUGI Addict
    Join Date
    2015-12
    Location
    Orlando, FL
    Posts
    1,049
    Login to Give a bone
    0

    Default Re: Calculated Value

    Text data is not allowed within the conditional statement. You need to create an instance integer parameter, for example "RoomType", that applies to the type of entities that you are scheduling. Then, assign an integer value for each type of room. Then include that parameter in your schedule. Then create a calculated value of area type, with the formula.

    If there are only two types, 0 for Office and 1 for Auditorium, it's a simple IF, like this:
    If RoomType is 0 (it's an Office), Divide "Area" by 300, otherwise, make my value 77 :
    Code:
    IF ( RoomType = 0, Area / 300, 77)
    If there are more room types, 1, 2, 3, etc. ... you need to use embedded IF's, like this:
    Code:
    IF(RoomType=0, Area/300, IF(RoomType = 1,77, IF(RoomType = 2, 50,100)))
    Last edited by alfredo medina; 2010-07-27 at 08:38 PM.

  3. #3
    Member
    Join Date
    2009-04
    Location
    Baltimore, Maryland
    Posts
    18
    Login to Give a bone
    0

    Default Re: Calculated Value

    Quote Originally Posted by Alfredo Medina View Post
    If there are more room types, 1, 2, 3, etc. ... you need to use embedded IF's, like this:
    Code:
    IF(RoomType=0, Area/300, IF(RoomType = 1,77, IF(RoomType = 2, 50,100)))
    ok.... I have a big Embedded IF issue here - i am trying to write my frist Embedded IF Formula - but i am doing so for plumbing fixture counts based on an IPC table... so there are 26 different categories / options / formulas...

    I wrote each one seperately in word to keep them straight - and then combined all of them into a single line for the calculated value formula. However i am getting a "Bad IF Statement format" error message saying that i am not following the proper format.

    I get that this is a ridiculously long formula, but any chance anyone could review it to see where i went wrong?
    Attached Files Attached Files

  4. #4
    100 Club
    Join Date
    2006-11
    Posts
    159
    Login to Give a bone
    0

    Default Re: Calculated Value

    copy paste the formula in word then ctrl+f and check if the number of "(" and ")"are equal

  5. #5
    Member
    Join Date
    2009-04
    Location
    Baltimore, Maryland
    Posts
    18
    Login to Give a bone
    0

    Default Re: Calculated Value

    Well - that is much easier than my pointing with my finger on the screen method
    nonetheless - there are an equal number of each - 56.

  6. #6
    AUGI Addict
    Join Date
    2015-12
    Location
    Orlando, FL
    Posts
    1,049
    Login to Give a bone
    1

    Default Re: Calculated Value

    The format for an IF formula is:
    Code:
    IF ( condition , <result if true > , <result if false> )
    In embedded IF's, the <result if false> part is another IF. Therefore, the last IF, because it is the last one, must have a <result if false> that is a value.

    Look at my example in my previous message:
    Code:
    IF(RoomType=0, Area/300, IF(RoomType = 1,77, IF(RoomType = 2, 50,100)))
    The number '100' is the last <result if false> part that I am talking about. Since this is the last IF, you need to tell Revit "otherwise, do this". You're missing that part in your formula. (Without looking at other issues)
    Last edited by alfredo medina; 2010-10-06 at 01:12 PM.

  7. #7
    I could stop if I wanted to
    Join Date
    2007-07
    Location
    London, UK
    Posts
    361
    Login to Give a bone
    0

    Default Re: Calculated Value

    I wouldn't use formulas like that.
    My suggestion is a rooms key schedule. The key would be "OFFICE", "AUDITORIUM", etc.
    Then I would add a type_value parameter with the corresponding value of 300, 77, etc.
    Those parameters will be very easy to control, and the main schedule would just have a Area/type_value formula.
    It seems so much simpler.

  8. #8
    Member
    Join Date
    2009-04
    Location
    Baltimore, Maryland
    Posts
    18
    Login to Give a bone
    0

    Default Re: Calculated Value

    Thanks Alfredo!
    That seems to have fixed the problem. I took out all of the line items that had a conditional true = "WATER_CLOSETS_MALE" and had that just be the universal False condition...
    Only problem is that that parameter was a Text parameter that had things like "1 per bed" or "1 per cell" typed in - and therefore cannot be displayed within the number calculated value

    Is there any way in an IF/THEN calculated value to have numbers and text be the result?

  9. #9
    AUGI Addict
    Join Date
    2015-12
    Location
    Orlando, FL
    Posts
    1,049
    Login to Give a bone
    0

    Default Re: Calculated Value

    Quote Originally Posted by nharburger View Post
    Thanks Alfredo! That seems to have fixed the problem. ...Is there any way in an IF/THEN calculated value to have numbers and text be the result?
    No. That is true in programming languages where there is a data type called "variant", which accepts multiple kinds of data types, but in the features available for the Revit user, the data type defines the result. If the data type is Text, you can't give it an integer, and vice versa.
    Last edited by alfredo medina; 2010-10-06 at 01:49 PM.

Similar Threads

  1. Calculated Value in Key Schedule
    By jon111712 in forum Revit Architecture - General
    Replies: 39
    Last Post: 2014-04-10, 01:10 AM
  2. 2013: Schedule - calculated value / calculated field
    By RayRay4105 in forum Revit - API
    Replies: 2
    Last Post: 2013-02-23, 04:30 PM
  3. 2013: Calculated Value for MCB/MLO Panels
    By Armando Martinez in forum Revit MEP - General
    Replies: 6
    Last Post: 2013-02-18, 04:48 PM
  4. Tag a calculated value
    By Wish List System in forum Revit Architecture - Wish List
    Replies: 0
    Last Post: 2012-06-13, 06:17 PM
  5. Calculated Values
    By narlee in forum Revit Architecture - General
    Replies: 2
    Last Post: 2008-01-12, 06:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •