+ Reply to Thread
Results 1 to 7 of 7

FALSE answer displayed on formula - should work!

  1. #1
    Registered User
    Join Date
    01-03-2013
    Location
    Coventry, England
    MS-Off Ver
    Excel 2010
    Posts
    5

    FALSE answer displayed on formula - should work!

    Hi All - Newbie to the Forum here!

    I am trying to get a Nested IF formula to work, but only one side of it seems to work and the other side gives me a FALSE

    =IF(N14="Q",SUM(G1+(VLOOKUP(M1,'Free Time Deals'!$C$4:$L$50,6)-1),IF(N1="L",SUM(J1+(VLOOKUP(M1,'Free Time Deals'!$C$4:$L$50,2)-1)))))

    It is fairly simple, all I am trying to do is look up an agreed figure (a date) and add onto it from an array the figure that corresponds to the record. I have managed to get it to calculate correctly when N1="Q" but if N1="L" the return is FALSE.

    I have tried just using a single IF, THEN combo (below) but this gives me the same issue

    =IF(N1="Q",SUM(G1+(VLOOKUP(M1,'Free Time Deals'!$C$4:$L$50,6)-1),SUM(J1+(VLOOKUP(M1,'Free Time Deals'!$C$4:$L$50,2)-1))))

    Any ideas would be gratefully received!!

    Simon

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: FALSE answer displayed on formula - should work!

    Simon

    What should the formula return if N1 doesn't equal Q or L?
    If posting code please use code tags, see here.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: FALSE answer displayed on formula - should work!

    you dont need to use sum if you are just adding 2 numbers together like that. also, you dont need to use all the ()'s that you have.

    you have 2 nested if()'s there, the 1st tests for N1=Q, if not found, then it tests for N1=L, if not found, then, as asked above, what should it do?

    version 1...
    =IF(N14="Q",G1+VLOOKUP(M1,'Free Time Deals'!$C$4:$L$50,6)-1,IF(N1="L",J1+VLOOKUP(M1,'Free Time Deals'!$C$4:$L$50,2)-1),"")
    version 2
    =IF(N14="Q",G1+VLOOKUP(M1,'Free Time Deals'!$C$4:$L$50,6)-1,J1+VLOOKUP(M1,'Free Time Deals'!$C$4:$L$50,2)-1)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    01-03-2013
    Location
    Coventry, England
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: FALSE answer displayed on formula - should work!

    Hi Guys

    N1 should return a blank or a zero if it doesn't meet either criteria.

    I should say that G1 or J1 are dates and I am trying to add a fixed number of days to that, for example - if G1 is 02/01/2013 and N1 = "Q" then it needs to add 15 days.or if "L" it needs to add 7 days to J1

    =IF(N1="Q",G1+VLOOKUP(M1,'Free Time Deals'!$C$4:$L$50,6)-1,IF(N1="L",J1+VLOOKUP(M1,'Free Time Deals'!$C$4:$L$50,2)-1),"")

    the formula above just gives me a #VALUE Error

    I know that sometimes I overthink it!

    Simon

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: FALSE answer displayed on formula - should work!

    perhaps it would be easier to help you if you uploaded a sample workbook, showing what data you are working with, a few examples of what your expected outcome would be, and how you would arrive at that (remove any confidential info if necessary).

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.

  6. #6
    Registered User
    Join Date
    01-03-2013
    Location
    Coventry, England
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: FALSE answer displayed on formula - should work!

    Hi There

    Attached the file showing what i want it to do - the only two responses will be Q or L.

    What I am trying to do is create a file where I import from our software the containers we have for delivery and it shows what the date the container should be back on quay is (column O)

    The parameters are dates from Landing (L) and date off quay (Q)

    Different shippers give us different rates and these constantly change so the requirement to be able to adjust the rate is why I need a seperate sheet.

    You may say "wow - so complicated, here is an easier way to do it!" - and I will be grateful!!

    Regards
    Simon
    Attached Files Attached Files

  7. #7
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: FALSE answer displayed on formula - should work!

    Wrong placement of Parenthesis....

    =IF(N3="Q",SUM(G3+(VLOOKUP(M3,'Free Time Deals'!$C$3:$F$49,3)-1)),IF(N3="L",SUM(J3+(VLOOKUP(M3,'Free Time Deals'!$C$3:$F$49,2)-1))))


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  8. #8
    Registered User
    Join Date
    01-03-2013
    Location
    Coventry, England
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: FALSE answer displayed on formula - should work!

    Thanks to all those who helped - I knew you would!

    Just one misplaced parenthesis!

    Thanks Again

    Simon

+ 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