+ Reply to Thread
Results 1 to 4 of 4

Cannot make nested if's work

  1. #1
    Registered User
    Join Date
    03-20-2009
    Location
    Phila, PA
    MS-Off Ver
    Excel 2003
    Posts
    56

    Cannot make nested if's work

    I have a formula that works but is incorrect. It is for calculating how many 2x4's I need to build a wall.
    On a sheet called Tasks I have the following:
    Cell use
    B7 Build wall Yes or No
    B8 4" or 6" wall
    B9 length of wall in inches
    B10 height of wall in inches
    B20 Need bottom plate to be pressure treated? Yes or No

    On another sheet called Projectmaster I have the following in cell C9, which determines how many 8' long 2x4's are needed:

    =IF(AND(Tasks!B7="y",Tasks!B8=4,Tasks!B9>0,Tasks!B10<97),ROUNDUP(((Tasks!B9/96)*2)+(Tasks!B9/16)+1,0),0)

    In cell C10 I have this, which determines how many 10' long 2x4's are needed:

    =IF(AND(Tasks!B7="y",Tasks!B8=4,Tasks!B9>0,Tasks!B10>96,Tasks!B10<121),ROUNDUP(((Tasks!B9/96)*2)+(Tasks!B9/16)+1,0),0)

    Now these formulas work OK, but if the wall is longer than 96" I would rather use longer top and bottom plates, i.e. a 120" wall could use two 10' plates instead of two 8' and two 2' pieces. Same applies if the wall is longer than 10' I would want to use 12' plates.

    I tried adding an if statement in front of the "Tasks!B9/96)*2)" statement, but keep being told formula contains an error.

    Can anyone suggest how I can test the length of the wall inside this formula and choose the correct length based on Tasks!B9?

    As an example, a 8' high wall that is 10' long should have nine 2x4x8' and two 2x4x10'.

    Or would a lookup table be better to use?
    Last edited by rfcomm2k; 12-18-2014 at 12:23 PM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,936

    Re: Cannot make nested if's work

    Attach a Workbook
    • Click Advanced (next to quick post),
    • Scroll down until you see "Manage Attachments",
    • Click that then select "add files" (top right corner).
    • Click "Select Files" find your file, click "open" click "upload"
    • Once the upload is completed the file name will appear below the input boxes in this window.
    • Click "Done" at bottom right to close the Attachment Manager.
    • Click "Submit Reply"
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    03-20-2009
    Location
    Phila, PA
    MS-Off Ver
    Excel 2003
    Posts
    56

    Re: Cannot make nested if's work

    Thanx for that info, but I already knew how to upload files. What does that have to do with my original post?

    Are you suggesting I upload my file? I will need to make a lot of changes to it before I upload, because as it is it is 13MB in size, and I doubt I could upload that much.

    I will work on abbreviating the file to see if I can get it to a manageable size.

  4. #4
    Registered User
    Join Date
    03-20-2009
    Location
    Phila, PA
    MS-Off Ver
    Excel 2003
    Posts
    56

    Re: Cannot make nested if's work

    Here is the abbreviated file.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] F4 doesn't work only in excel, how to make it work again?
    By Dave H in forum Excel General
    Replies: 1
    Last Post: 02-26-2014, 11:22 AM
  2. [SOLVED] nested if formula that i cant sem to make work
    By fordtough68 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-19-2013, 11:44 AM
  3. [SOLVED] How to make the macro work for all rows in the work sheet
    By Valli nayaki in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-18-2013, 10:43 PM
  4. a work around for nested IF?
    By valkie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-06-2012, 01:11 AM
  5. Spin button in a work sheet - how do I make it work?
    By mike_l_moore@msn.com in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-07-2005, 04:06 PM

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