+ Reply to Thread
Results 1 to 3 of 3

IF function yet want to stop counting when another cell has data entered.

  1. #1
    Registered User
    Join Date
    02-08-2008
    Location
    Co. Down, Ireland.
    Posts
    53

    IF function yet want to stop counting when another cell has data entered.

    =IF(U90="","",($E$5-Q90))

    Hi all,

    The above IF function is being used to only calculate when cell U90 is empty. Yet is there a way to stop the function calculating when a date is entered into cell U90?

  2. #2
    Forum Contributor
    Join Date
    12-02-2004
    Location
    London
    Posts
    255
    Dates in Excel are stored as numbers and then formated to a date format, therefore Excel cannot distinguish between a number and a date. As long as this is OK, then you can use the formula:-

    =IF(OR(U90="",ISNUMBER(U90)),"",($E$5-Q90))

    However, if you want to look for dates only, you would have to format the cell as text (which would then stop any validation on a date being entered correctly i.e. 31/4/08, would get converted to 1/5/08 normally, however if you enter it as text it will stay as 31/4/08), you could then change the fomula to:-

    =IF(OR(U90="",AND(LEN(U90)=8,MID(U90,3,1)="/",MID(U90,6,1)="/")),"",($E$5-Q90))

    The above requires the date to be entered in the format of DD/MM/YY, or MM/DD/YY. If you want any other format you would need to amend the formula. The above is checking for the text to be 8 characters long and in postion 3 and 6 there is a "/".

    Hope this helps

  3. #3
    Registered User
    Join Date
    02-08-2008
    Location
    Co. Down, Ireland.
    Posts
    53
    Thanks for the reply Gary.

    I think the 1st formula is more suitable to what I want to achive.

    I've attached an example of the spreadsheet to give a clearer view.
    Attached Files Attached Files

+ 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