+ Reply to Thread
Results 1 to 9 of 9

Nesting IF Statement

  1. #1
    Registered User
    Join Date
    11-01-2011
    Location
    USA
    MS-Off Ver
    Excel 2004 for Mac
    Posts
    41

    Nesting IF Statement

    Cross posted at http://www.vbaexpress.com/forum/show...135#post255149



    I could really use a big hand and any help is much appreciated. I'm just not proficient enough to nest all of theses statements into a single, concise statement that would live in cell G24.



    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by firehousetk; 11-23-2011 at 12:35 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Nesting Complex IF Statements

    Hi,

    Please upload your workbook so that we can see the request in context. It's almost certain that there will be more efficient way than nested IF statements but we can advise more accurately when we see the workbook.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    11-01-2011
    Location
    USA
    MS-Off Ver
    Excel 2004 for Mac
    Posts
    41

    Re: Nesting Complex IF Statements

    Certainly. Please see the attached. Thanks again!
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Nesting Complex IF Statements

    I'm afraid your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

    http://vbaexpress.com/forum/showthread.php?t=39937

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Nesting Complex IF Statements

    Hi,

    Please now explain what you expect the final result to be in G24 and importantly explain how you arrive at it with reference to all the specific cells that you are taking into account in your calculation.

    Regards

  6. #6
    Registered User
    Join Date
    11-01-2011
    Location
    USA
    MS-Off Ver
    Excel 2004 for Mac
    Posts
    41

    Re: Nesting Complex IF Statements

    Absolutely. By combining the 12 statements and outputting the result in G24, I expect the final result to be a date, whereas the result depends on the following conditions:

    H38 is a type of material
    G28 is the Day of the Week expressed as a number
    G29 is the time of day
    G26 is the day the document was created

    For example, if the material is canvas, and the day of the week is tuesday, and the time of day is 7AM, then G24 would be G26 + 1.

    Did I explain this well enough? I've internalized it, I suppose, and now don't even know If i'm explaining it properly! Thanks again.

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Nesting Complex IF Statements

    Hi,

    You still haven't said what you expect the final result should be in G24, and importantly why.

    Regards

  8. #8
    Registered User
    Join Date
    11-01-2011
    Location
    USA
    MS-Off Ver
    Excel 2004 for Mac
    Posts
    41

    Re: Nesting Complex IF Statements

    The final result is not static as it depends on the conditions. It will, however, be a date plus a defined number as given be satisfied conditions. G24 will take the day the document was created (G26) and add a defined number of days(as defined in the statement), thus creating a new date.

    As to the why, I don't think I understand the importance.

  9. #9
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Nesting Complex IF Statements

    firehousetk,

    Since you already have the formulas, you can use a lookup to find which one results in a number instead of "Ok" and then pull the result for that formula. I looked into nesting all the formulas together, but with a .xls file, there are too many nested statements and the formula fails, so I think the lookup is the way to go for this one.

    Attached is a modified version of your workbook. In cell G24 is the formula:
    Please Login or Register  to view this content.


    Then you can just hide rows 49 to 61 if you want.
    Attached Files Attached Files
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

+ 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