+ Reply to Thread
Results 1 to 3 of 3

if stmt trouble

  1. #1
    Registered User
    Join Date
    02-23-2006
    Posts
    13

    if stmt trouble

    here is my current formula:
    =ROUND(IF(AND(D7="Gallons",D8="O.D."),(B7*231)/(0.7854*B8^2),IF(AND(D7="O.D.",D8="Gallons"),(B8*231)/(0.7854*B7^2),IF(AND(D7="Straight Side",D8="Gallons"),((B8*231)/(0.7854*B7))^0.5,IF(AND(D7="Gallons",D8="Straight Side"),((231*B7)/(0.7854*B8))^0.5,IF(AND(D7="O.D.",D8="Straight Side"),(0.7854*B7^2*B8)/231,(0.7854*B8^2*B7)/231))))),4)

    this was working great until I was asked to add another constraint.
    This calculates diameter or height or gallons depending on what was entered. Problem is that this was set up for input of inches and now the input can be either inches or feet. These formulas only work for inches. Now I need to check to see if the user inputed inches or feet and I can't fit that many if statements into this.
    Any suggestions?
    I know theres a better way to do this, but am at a loss.
    Thanks
    Lisa

  2. #2
    Niek Otten
    Guest

    Re: if stmt trouble

    Look here:

    http://www.cpearson.com/excel/nested.htm

    --
    Kind regards,

    Niek Otten

    "vencopbrass" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > here is my current formula:
    > =ROUND(IF(AND(D7="Gallons",D8="O.D."),(B7*231)/(0.7854*B8^2),IF(AND(D7="O.D.",D8="Gallons"),(B8*231)/(0.7854*B7^2),IF(AND(D7="Straight
    > Side",D8="Gallons"),((B8*231)/(0.7854*B7))^0.5,IF(AND(D7="Gallons",D8="Straight
    > Side"),((231*B7)/(0.7854*B8))^0.5,IF(AND(D7="O.D.",D8="Straight
    > Side"),(0.7854*B7^2*B8)/231,(0.7854*B8^2*B7)/231))))),4)
    >
    > this was working great until I was asked to add another constraint.
    > This calculates diameter or height or gallons depending on what was
    > entered. Problem is that this was set up for input of inches and now
    > the input can be either inches or feet. These formulas only work for
    > inches. Now I need to check to see if the user inputed inches or feet
    > and I can't fit that many if statements into this.
    > Any suggestions?
    > I know theres a better way to do this, but am at a loss.
    > Thanks
    > Lisa
    >
    >
    > --
    > vencopbrass
    > ------------------------------------------------------------------------
    > vencopbrass's Profile:
    > http://www.excelforum.com/member.php...o&userid=31868
    > View this thread: http://www.excelforum.com/showthread...hreadid=516346
    >




  3. #3
    paul
    Guest

    RE: if stmt trouble

    you could alter your input cells to include feet and have a helper cell
    convert to inches,add to the inches cell and have your formula look at the
    helper cell.
    --
    paul
    remove nospam for email addy!



    "vencopbrass" wrote:

    >
    > here is my current formula:
    > =ROUND(IF(AND(D7="Gallons",D8="O.D."),(B7*231)/(0.7854*B8^2),IF(AND(D7="O.D.",D8="Gallons"),(B8*231)/(0.7854*B7^2),IF(AND(D7="Straight
    > Side",D8="Gallons"),((B8*231)/(0.7854*B7))^0.5,IF(AND(D7="Gallons",D8="Straight
    > Side"),((231*B7)/(0.7854*B8))^0.5,IF(AND(D7="O.D.",D8="Straight
    > Side"),(0.7854*B7^2*B8)/231,(0.7854*B8^2*B7)/231))))),4)
    >
    > this was working great until I was asked to add another constraint.
    > This calculates diameter or height or gallons depending on what was
    > entered. Problem is that this was set up for input of inches and now
    > the input can be either inches or feet. These formulas only work for
    > inches. Now I need to check to see if the user inputed inches or feet
    > and I can't fit that many if statements into this.
    > Any suggestions?
    > I know theres a better way to do this, but am at a loss.
    > Thanks
    > Lisa
    >
    >
    > --
    > vencopbrass
    > ------------------------------------------------------------------------
    > vencopbrass's Profile: http://www.excelforum.com/member.php...o&userid=31868
    > View this thread: http://www.excelforum.com/showthread...hreadid=516346
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1