+ Reply to Thread
Results 1 to 10 of 10

Need help with Nested IF function

  1. #1
    Registered User
    Join Date
    08-10-2012
    Location
    Toronto
    MS-Off Ver
    Office 365
    Posts
    35

    Need help with Nested IF function

    Hi,

    I will really appreciate if somebody give me a solution for the attached conditions. I am looking to get different results beased on different conditions but i cannot get it. I dont know whether i am nesting wrong formula or something else.. I will trulyyyy appreciate any tips. Thanks

    Waheed
    Last edited by warshad; 09-19-2012 at 10:15 AM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,416

    Re: Need help with Nested IF function

    You don't have any data in columns S or I in the data sheet, so please re-state conditions 2 and 4.

    Pete

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Need help with Nested IF function

    Hi Waheed,

    Here's what I've got so far - I'm posting so I can reconnect tomorrow - my questions are Pete's questions.

    Maybe you can complete the routine:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Registered User
    Join Date
    08-10-2012
    Location
    Toronto
    MS-Off Ver
    Office 365
    Posts
    35

    Re: Need help with Nested IF function

    Hi Pete ,
    sorry.hey I meant to say column E not S
    Thanks

    Waheed

  5. #5
    Registered User
    Join Date
    08-10-2012
    Location
    Toronto
    MS-Off Ver
    Office 365
    Posts
    35

    Re: Need help with Nested IF function

    Hi Guys,

    I have revised the conditions in the file with the correct columns. Thanks

    Waheed
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    08-10-2012
    Location
    Toronto
    MS-Off Ver
    Office 365
    Posts
    35

    Re: Need help with Nested IF function

    Hi there,

    i actually dont need the VBA script.... all i need a proper and right formula to get the data. Thanks

    waheed

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Need help with Nested IF function

    Hi Waheed,

    Here's VBA that seems to work - sorry that you don't want it - Pete can probably deliver a formula for you:

    Please Login or Register  to view this content.

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,416

    Re: Need help with Nested IF function

    Quote Originally Posted by xladept View Post
    ... Pete can probably deliver a formula for you:
    Such faith !!

    This is close, but is not quite matching all your suggested values. I put this formula in F2:

    =IFERROR(VLOOKUP(A2,'Data to lookup the dates'!A:E,IF(C2="Remodel",IF(AND(B2="Owned",VLOOKUP(A2,'Data to lookup the dates'!A:E,5,0)=0),2,5),IF(OR(B2="Top Lease",B2="Ground Lease"),IF(VLOOKUP(A2,'Data to lookup the dates'!A:E,3,0)=0,4,3))),0),"Fix")

    and copied down. It's not quite working in all cases, but I'm posting it now in case I don't get chance to come back to it, as I have to catch a plane at 7:00 am in the morning, so I must go and do some packing and then an early night.

    Hope this helps.

    Pete

  9. #9
    Registered User
    Join Date
    08-10-2012
    Location
    Toronto
    MS-Off Ver
    Office 365
    Posts
    35

    Re: Need help with Nested IF function

    Thanks Pete. The formula is not working on some of the conditions and i tried to tweak it in so many ways but it does not seem to work. I will keep trying still. Thanks

    Waheed

  10. #10
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,416

    Re: Need help with Nested IF function

    Here's an improvement. You didn't quite state your conditions succinctly, as the "Owned" condition seemed to apply only to "Remodel" being in C2 according to your text. There were 4 entries for Owner without Remodel which caused some problems with the other formula, so this formula (again in F2) corrects for that and now there is only one condition not being met (the last one):

    =IFERROR(VLOOKUP(A17,'Data to lookup the dates'!A:E,IF(C17="Remodel",IF(AND(B17="Owned",VLOOKUP(A17,'Data to lookup the dates'!A:E,5,0)=0),2,5),IF(B17="Owned",2,IF(OR(B17="Top Lease",B17="Ground Lease"),IF(VLOOKUP(A17,'Data to lookup the dates'!A:E,3,0)=0,4,3)))),0),"Fix")

    The failing condition is for a Remodel and a Top Lease, but you haven't defined a condition for Top Lease with Remodel - I suppose you want this to be treated similar to Owned and Remodel with an empty date, in which case the formula will become:

    =IFERROR(VLOOKUP(A2,'Data to lookup the dates'!A:E,IF(C2="Remodel",IF(AND(B2="Owned",VLOOKUP(A2,'Data to lookup the dates'!A:E,5,0)=0),2,IF(AND(RIGHT(B2,5)="Lease",VLOOKUP(A2,'Data to lookup the dates'!A:E,5,0)=0),3,5)),IF(B2="Owned",2,IF(OR(B2="Top Lease",B2="Ground Lease"),IF(VLOOKUP(A2,'Data to lookup the dates'!A:E,3,0)=0,4,3)))),0),"Fix")

    and this does indeed give you the same results as you expected.

    I couldn't leave this hanging before going away, so I shall get some shut-eye now.

    Hope this helps.

    Pete

+ 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