+ Reply to Thread
Results 1 to 6 of 6

Query Returning either/or from Date

  1. #1
    Registered User
    Join Date
    04-24-2017
    Location
    Lincoln, England
    MS-Off Ver
    2016
    Posts
    27

    Query Returning either/or from Date

    I have a basic shipping excel spreadsheet, in column A I have dates, and in column B I would like it to show when I can ship as there's a processing hold.
    So if the day of the week from column A is Saturday, Sunday, Monday or Tuesday then it displays Friday, but if its Wednesday, Thursday or Friday it would display Wednesday.
    I know this should be simple but i just can't get the IF query to work. Please help.
    Thanks in advance.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,980

    Re: Query Returning either/or from Date

    Try this:

    =IF(WEEKDAY(A1,16)<5,"Friday","Wednesday")
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    04-24-2017
    Location
    Lincoln, England
    MS-Off Ver
    2016
    Posts
    27

    Re: Query Returning either/or from Date

    Thanks your assistance, unfortunately that didn't work. Any other suggestions?

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,980

    Re: Query Returning either/or from Date

    What do you mean? It works here:

    Excel 2016 (Windows) 32 bit
    A
    B
    C
    1
    12/02/2020
    Wednesday B1: =IF(WEEKDAY(A1,16)<5,"Friday","Wednesday")
    Sheet: Sheet1

    Provide a sample workbook, please. Maybe your dates are just text and not dates at all?

  5. #5
    Registered User
    Join Date
    04-24-2017
    Location
    Lincoln, England
    MS-Off Ver
    2016
    Posts
    27

    Re: Query Returning either/or from Date

    My apologies, user error my end, worked perfectly once I typed it in correctly.

    Is there anyway to modify the formula that if A1 is empty, B1 will be blank?

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,980

    Re: Query Returning either/or from Date

    Yes, easily:

    =IF(A1="","",IF(WEEKDAY(A1,16)<5,"Friday","Wednesday"))

+ 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. MS Query not returning all data to Excel
    By kenny.fsw in forum Access Tables & Databases
    Replies: 1
    Last Post: 07-21-2015, 11:40 PM
  2. Replies: 3
    Last Post: 11-29-2012, 08:49 AM
  3. [SOLVED] query table returning no data
    By Confused_need_help in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-11-2012, 08:14 PM
  4. Web Query returning wrong time but right date
    By sean13128 in forum Excel General
    Replies: 0
    Last Post: 04-01-2010, 03:38 PM
  5. External query parameter, but not returning the value?
    By tangcla in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-04-2009, 12:33 AM
  6. returning data from microsoft query
    By mintmin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-08-2009, 02:13 AM
  7. [SOLVED] SQL Query not returning correct results
    By Stephen in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-20-2006, 08:25 AM

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