+ Reply to Thread
Results 1 to 12 of 12

change a number looking vs date

  1. #1
    Registered User
    Join Date
    10-30-2006
    Posts
    41

    change a number looking vs date

    hi I have been working on a database that keeps account of numbers etc,

    at the moment I have a section that says it will bring a price depending on how many weeks past the end date it is:

    if the end date was 16.5.10 and todays date was 1 week past (23.5.10)then I type a 1,
    if 2 weeks past then I type a 2 (30.5.10) is it possible to create an statement that would look at the date and when it gets to 7 days,14 days ,21 it would show the number 1, 2 ,3

    I have been trying but have got a bit stuck, even if u canjust tell me the start of the statement I need :if, vlookup etc

    thanks all

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: change a number looking vs date

    Hello, with your date to be examined in column A, you could use

    =INT((today()-A2)/7)

    copy down.

    cheers

  3. #3
    Registered User
    Join Date
    10-30-2006
    Posts
    41

    Re: change a number looking vs date

    I added the examined date to the correct place but just keeps coming up #value, hmm

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: change a number looking vs date

    time to post a workbook, maybe? So we can see where/what your data really is.

  5. #5
    Registered User
    Join Date
    10-30-2006
    Posts
    41

    Re: change a number looking vs date

    here is a version of the test doc I am trying out
    Attached Files Attached Files

  6. #6
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: change a number looking vs date

    Your "dates" are not dates, but text. Enter the dates as dates, format them with a date format to show how you would like to see them. Then use the formula I provided earlier.

  7. #7
    Registered User
    Join Date
    10-22-2007
    Location
    Mumbai, India
    MS-Off Ver
    MS Excel 2007
    Posts
    59

    Re: change a number looking vs date

    The date you are storing is in a text format. Store it in a date format Teylyn's formula will work fine.

  8. #8
    Registered User
    Join Date
    10-30-2006
    Posts
    41

    Re: change a number looking vs date

    does it matter what date formate, if I point the formula u gave to the end date it pops up value,

    sorry to be hastle I really appreiciate your help

  9. #9
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: change a number looking vs date

    Pardon?

    Yes it does matter. It's not about format of the cell. It's about the data type. You've entered text. Excel does not recognise that as a date and can not perform any calculations with it.

    If you enter real dates, Excel can.

  10. #10
    Registered User
    Join Date
    10-30-2006
    Posts
    41

    Re: change a number looking vs date

    sorry I mistyped that question I meant when u format the celll to date there are different layouts to show the date

  11. #11
    Registered User
    Join Date
    11-22-2009
    Location
    Newcastle,England
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: change a number looking vs date

    pick the format you want it will not affect anything.

    excel stores dates as a number like 40686, when you select a date format it just dresses this up to look like a "real" date.

    choose how you want it to be shown.


    If you are getting a #value error it is because your date is stored as "text". You can check this by changing the format of the date to "number" if it stays the same and doesnt convert to something like 40584 style then it is still text.

    To convert the number you need to use =date() function. Split the "text" date in to month, day, year using left(), right() and mid() functions. Then insert those in to date()

  12. #12
    Registered User
    Join Date
    10-30-2006
    Posts
    41

    Re: change a number looking vs date

    Oh great got it going, Thank you soooo much guys you have been awesome, I will look at others and help if I can, not just here to take from you,

    brill

    thanks for this

+ 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