+ Reply to Thread
Results 1 to 14 of 14

If function with date instead of number

  1. #1
    Registered User
    Join Date
    03-15-2012
    Location
    Stavanger, Norway
    MS-Off Ver
    Excel 2016
    Posts
    77

    If function with date instead of number

    Hello!

    I have a list of persons, where each persons have dates, for when going from A to B and from B to A. F. ex person X is going to from B to A on 24.04.2012, and from A to B 25.07.2012. I would like a if function which tells me whether they X are in B or A, but I was not able with normal if function because it looks at the date as it is a number, not a specific date. Does anyone have any ideas, how I can make the if function look at the cell as dates not numbers. hope I made myself clear, thanks for any reply

    Ossa

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: If function with date instead of number

    Hi

    I think would be better if you upload a small sample workbook.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    06-26-2012
    Location
    Krakow, Poland
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: If function with date instead of number

    Hi

    Are the cells formated as dates? To check this, try adding '1' to a cell and see wheteher the result is the next day. Besides, I am not sure this will work with '.'. Try replacing all '.' with '-', so that you have 24-04-2012, etc. Then excel should reat it as dates. Is that what you are asking about?

  4. #4
    Registered User
    Join Date
    03-15-2012
    Location
    Stavanger, Norway
    MS-Off Ver
    Excel 2016
    Posts
    77

    Re: If function with date instead of number

    Thanks for quick reply.

    Attached is my workbookBrigades_18.06.2012.xlsx

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: If function with date instead of number

    Why this formula, does not works for you?

    Give us the expected result and why??

  6. #6
    Registered User
    Join Date
    03-15-2012
    Location
    Stavanger, Norway
    MS-Off Ver
    Excel 2016
    Posts
    77

    Re: If function with date instead of number

    If you look at person 1. He travels from to Norway 14.04.2012, and from Norway 24.03.2012. Which means he is in Norway now. And if E2>F2 then G2 should be Y2 but it is not, because if I change the format to numbers, F2 gets a higher value than E2

  7. #7
    Registered User
    Join Date
    06-26-2012
    Location
    Krakow, Poland
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: If function with date instead of number

    Replace all '.' with '-'. Select the whole two columns with dates and Use ctrl+h (replace all). It should work after this adjustment

  8. #8
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: If function with date instead of number

    Agree. It's format problem! Your formula is correct and works OK if you change the format in dates.

  9. #9
    Registered User
    Join Date
    03-15-2012
    Location
    Stavanger, Norway
    MS-Off Ver
    Excel 2016
    Posts
    77

    Re: If function with date instead of number

    Brigades_18.06.2012.xlsxSorry, but I cant make it work, I know about the format. But look here is a sheet with correct format, please take a look if you have time

  10. #10
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: If function with date instead of number

    I just made a few rows(green color)
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    03-15-2012
    Location
    Stavanger, Norway
    MS-Off Ver
    Excel 2016
    Posts
    77

    Re: If function with date instead of number

    Thanks, exactly. What changes did you make?

  12. #12
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: If function with date instead of number

    You are welcome.

    Nothing more dates format. See the green cells.

  13. #13
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: If function with date instead of number

    To easily change your "text" date to real dates, select the column,go to Data -Text to Columns - Next - Next -
    In the "column data format" box check Date - Finish

  14. #14
    Registered User
    Join Date
    03-15-2012
    Location
    Stavanger, Norway
    MS-Off Ver
    Excel 2016
    Posts
    77

    Re: If function with date instead of number

    It worked, thanks a lot for your time!

+ 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