+ Reply to Thread
Results 1 to 7 of 7

If date is between then add 1

Hybrid View

  1. #1
    Registered User
    Join Date
    10-08-2012
    Location
    Finland
    MS-Off Ver
    Excel 2010
    Posts
    26

    If date is between then add 1

    Hello,

    I have a questions why the following formula does not work:

    "=IF(AND(Sheet2!A14:A300>AF1;Sheet2!A14:A300<AH1;TEXT(Sheet2!A14:A300;"dddd")=X3);1;0)

    Sheet2!A14:A300 are dates values between t.e 1.1.2014-31.12.2014.
    AF1 is the start date
    AH1 is the end date
    X3 is either "Mo,Tu, We.."

    The function works if date range is not added, so with only "text()-function."

    Any ideas?

    Cheers,


    T

  2. #2
    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
    53,048

    Re: If date is between then add 1

    Couple of shots in the dark - hard to say without seeing this with some data....

    1. that looks like an ARRAY formula, did you enter it using CTRL SHFT ENTER?
    2. You said X3 is either "Mo,Tu, We.., but your TEXT() is DDDD?
    3. Are your dates actual dates, and not text that looks like a date? Test with =ISNUMBER(cell-ref)...FALSE indicates text
    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

  3. #3
    Registered User
    Join Date
    10-08-2012
    Location
    Finland
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: If date is between then add 1

    Quote Originally Posted by FDibbins View Post
    Couple of shots in the dark - hard to say without seeing this with some data....

    1. that looks like an ARRAY formula, did you enter it using CTRL SHFT ENTER?
    2. You said X3 is either "Mo,Tu, We.., but your TEXT() is DDDD?
    3. Are your dates actual dates, and not text that looks like a date? Test with =ISNUMBER(cell-ref)...FALSE indicates text
    Hi!

    Thanks for the reply. Heres my answers:

    1. I used array, so it put up with ctrl shift enter.
    2. It was mistake X3 is monday, tuesday, etc. Not mo, tu, we etc., sorry
    3. Dates are actual, so the mentioned test gives true.

    I just don't get it :/

    Banaticus t.e is e.g, in swedish though.

    Regards,

    T

  4. #4
    Registered User
    Join Date
    10-08-2012
    Location
    Finland
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: If date is between then add 1

    Hmph None can not find the error in the formula? I sure do not, as all seems ok. The formula also works if the range is removed, so if you try with only Sheet2!A4 in both of the ranges it will work and adds 1.

    But I don't know what could be wrong with the range?

    As said earlier the range works also with only the Text() formula, so it seems that there is something wrong with the date range -thing. And for the information the outcome is "0", not an error.

    Best Regards,


    T

  5. #5
    Registered User
    Join Date
    06-26-2006
    Posts
    44

    Re: If date is between then add 1

    What is t.e?

  6. #6
    Registered User
    Join Date
    06-26-2006
    Posts
    44

    Re: If date is between then add 1

    What is Sheet2!A14:A300>AF1 does that mean Excel is supposed to compare every date in the A column, all 296 of them with the start date? That could be your problem. Set up a partially fixed reference, perhaps something like:
    Sheet2!$A14>AF1 or something else where only a single cell is being compared at a time. Same goes for TEXT(Sheet2!A14:A300;"dddd")

    "1. that looks like an ARRAY formula, did you enter it using CTRL SHFT ENTER?"

  7. #7
    Registered User
    Join Date
    10-08-2012
    Location
    Finland
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: If date is between then add 1

    Hi,

    As I said, the fuction works if the date range is taken of and use only single cell reference.

    But even though, I'd need it from the whole range, not just from one cell.

    The range is not a problem with the text() part as it works flawlesly So the problemm is not in the range, for someone reason it seems like Excel does not recognize the range or something like that.

+ 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. Counting if data falls on date between Start Date, End Date or Possible End Date
    By JessHasQuestions in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 07-26-2014, 08:01 AM
  2. [SOLVED] Index Match Based on One Date Criteria, Table Contains Beginning Date and End Date
    By jcox1953 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-09-2014, 02:41 PM
  3. Replies: 1
    Last Post: 10-02-2012, 02:42 PM
  4. Replies: 1
    Last Post: 09-28-2012, 08:52 AM
  5. Replies: 7
    Last Post: 11-16-2008, 05:48 PM

Tags for this Thread

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