+ Reply to Thread
Results 1 to 9 of 9

excel returns serial number instead of year: "1997"=35795

  1. #1
    Registered User
    Join Date
    09-08-2016
    Location
    Los Angeles, CA
    MS-Off Ver
    Office 365
    Posts
    22

    excel returns serial number instead of year: "1997"=35795

    Excel returns a serial number instead of the year, resulting in logic error. I need to keep the logical about comparing YEAR as this formula will be part of a larger lookup formula.

    In order to return TRUE, "1997" = stores_beg!$G$1.

    Screen Shot 2019-09-07 at 9.54.27 AM.png

    Although stores_beg!$G$1 does refers to 1997...

    Screen Shot 2019-09-07 at 9.55.19 AM.png

    ... however, it evaluates to a serial number 35795.

    Screen Shot 2019-09-07 at 9.53.58 AM.png

    The following have not worked:

    1. year()
    2. custom number format
    3. date number format

    This was originally the header for a table. Does it matter if the date is the header of a table, or whether it's just a range?

    A sample file is a attached.

    Thank you!
    Attached Files Attached Files
    Last edited by rkong; 09-07-2019 at 01:38 PM.

  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,457

    Re: excel returns serial number instead of year: "1997"=35795

    Will you please attach a small sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment (it hasn't worked for years, and despite our repeatedly asking the technical team who own the forum to fix it, they can't be bothered to do so), so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    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
    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,457

    Re: excel returns serial number instead of year: "1997"=35795

    Whilst waiting for your workbook, a reminder that dates ARE just serial numbers (starting on 01/01/1900).

  4. #4
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,289

    Re: excel returns serial number instead of year: "1997"=35795

    Without a excel example i should say try this:
    Please Login or Register  to view this content.
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  5. #5
    Registered User
    Join Date
    09-08-2016
    Location
    Los Angeles, CA
    MS-Off Ver
    Office 365
    Posts
    22

    Re: excel returns serial number instead of year: "1997"=35795

    Thank you for quick reply. Unfortunately, even =IF(1997=stores_beg!$G$1, TRUE, FALSE) returns FALSE.

  6. #6
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,289

    Re: excel returns serial number instead of year: "1997"=35795

    In this example it works good
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,289

    Re: excel returns serial number instead of year: "1997"=35795

    Maybe you can do it this way
    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    09-08-2016
    Location
    Los Angeles, CA
    MS-Off Ver
    Office 365
    Posts
    22

    Re: excel returns serial number instead of year: "1997"=35795

    Thank you again, popipipo. Your solution did solve the problem in the sample; it also helped me realize that I mischaracterized the problem.

    Since the larger problem was lookup by array over the range including the reference to the date 1997, placing a year() around the reference wouldn't solve the bigger problem. Actually, I'm not sure I fully understand why you solution didn't work.

    What I did instead was change the dates to TEXT. This seems to help with the lookup functions too.

    Thank you anyway for your attention and solutions. I learned something new.

  9. #9
    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,457

    Re: excel returns serial number instead of year: "1997"=35795

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. [SOLVED] Nested HLOOKUP returns "FALSE" in cell where result should be "0.00"
    By gammccubbin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-09-2016, 09:49 AM
  2. [SOLVED] IF Statement Evaluates as "TRUE" but Returns "FALSE" Value (Excel 2007)
    By Simcik in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-11-2014, 12:43 PM
  3. [SOLVED] Formula TEXT returns "yyyy" instead of the real year number
    By Hitch75 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 10-28-2013, 06:57 AM
  4. Replies: 3
    Last Post: 05-17-2012, 03:04 PM
  5. [SOLVED] How to Count number of "Error" and "OK" after the word "Instrument" found in table row
    By eltonlaw in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2012, 06:26 AM
  6. SQL against Excel Table returns nothing when "Where [ColumnName] = ""
    By rgi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-19-2010, 04:21 PM
  7. [SOLVED] "IF" formula returns zero or other incorrect number
    By Pat K. in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-06-2005, 02:00 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