+ Reply to Thread
Results 1 to 11 of 11

Using IF(AND syntax

  1. #1
    Registered User
    Join Date
    04-23-2013
    Location
    Shrewsbury, England
    MS-Off Ver
    Excel 2007
    Posts
    44

    Using IF(AND syntax

    Greetings, I cannot seem to work out what my syntax error is in the following formula:

    IF(B1="","",IF(AND(B1<A1,B1>A1-90),A1+360,B1+360))

    Column A refers to a date something is due, column B the date it was completed.
    The new due date is the calculation that I am trying to formulate.

    Can anyone help? Grateful for any assistance as always!

    Rgds
    Harry

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Using IF(AND syntax

    Syntax is ok, what about logic I don't know without example.xlsx file.

    EDIT: and with good description of course. In example should be: What you have and what you want to achieve
    Last edited by sandy666; 02-04-2017 at 04:59 PM.

  3. #3
    Registered User
    Join Date
    04-23-2013
    Location
    Shrewsbury, England
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Using IF(AND syntax

    Kinda like this

    Class returns
    A. B
    Due Completed
    10 Jan 2017 10 Dec 2016
    (New due date formula)

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Using IF(AND syntax

    Result should be ?

  5. #5
    Registered User
    Join Date
    04-23-2013
    Location
    Shrewsbury, England
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Using IF(AND syntax

    A2 is the result, either A1 a year later or B1 a year later, if that makes sense?

  6. #6
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Using IF(AND syntax

    I am asking about result of your formula....

    I got (short date) 05/01/2018 or (long date) 05 January 2018
    Is it correct?

  7. #7
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Using IF(AND syntax

    The best way is:

    Attach a sample workbook. (Not a picture!)
    Make sure there is just enough data to demonstrate your need. Include a BEFORE (original) sheet and an AFTER (required output) sheet in the workbook if needed to show the process you're trying to complete or automate.
    Make sure your desired results are shown, mock them up manually if necessary. Remember, it should reflect original structure of your data.
    Remember to desensitize the data.
    Note:
    • Please do not attach password protected workbooks/worksheets
    • Please do not attach file(s) from exterior servers
    • Please do not attach file(s) with enabled any Workbook Open/Autorun macros!

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

    About 20 rows of data, mark wrong result as yellow

  8. #8
    Registered User
    Join Date
    04-23-2013
    Location
    Shrewsbury, England
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Using IF(AND syntax

    That is the right result, a cross check would be to enter today's date and the result would be 31 Jan 18?

  9. #9
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Using IF(AND syntax

    Rather 30 January 2018
    If you want 31 January 2018 change 360 to 361 (with your default formula)

  10. #10
    Registered User
    Join Date
    04-23-2013
    Location
    Shrewsbury, England
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Using IF(AND syntax

    Tried formula on a blank workbook and it works for me too. Thanks for confirming the syntax! Rgds Harry

  11. #11
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Using IF(AND syntax

    You are welcome, thanks for the feedback

+ 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. Syntax
    By fatbassman in forum Excel General
    Replies: 9
    Last Post: 10-13-2013, 05:48 PM
  2. Need syntax
    By jaganexcel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-09-2013, 09:06 AM
  3. need help with VBA syntax
    By cbrf23 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-05-2011, 04:55 PM
  4. syntax help
    By TRJJK73 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-08-2009, 07:54 AM
  5. Need syntax help!
    By FCC in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-30-2006, 05:30 AM
  6. Need help with If/Then Syntax
    By Shani in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-05-2006, 02:15 PM
  7. [SOLVED] Syntax help please
    By GettingThere in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-18-2005, 09:05 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