+ Reply to Thread
Results 1 to 28 of 28

Formula to stop the counting based on date

  1. #1
    Registered User
    Join Date
    05-02-2012
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2007
    Posts
    36

    Formula to stop the counting based on date

    Hi to all wizards again!

    I have this problem that would really need your help.

    I have cell A1 with a value of 4/3/2012 and cell B1 with a formula =TODAY()-A1

    So, cell B1 there will continuously count the number of days with reference from cell A1

    Now, I want a formula on cell C1 that if I enter the current date then cell B1 will stop counting.

    Somebody please help.

    Thanks.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Formula to stop the counting based on date

    Hi joseph,

    You can use below formula which will replace the Today () from c1 if c1 has any date :-

    =IF(C1="",TODAY(),C1)-A1

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    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: Formula to stop the counting based on date

    Ηι

    ..Stop count, under which condition?
    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.

  4. #4
    Registered User
    Join Date
    05-02-2012
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Formula to stop the counting based on date

    Hi Sir Fotis,

    It will stop counting if I enter the current date on cell C1.

    Thanks.

  5. #5
    Registered User
    Join Date
    05-02-2012
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Formula to stop the counting based on date

    Hello Sir dilipandey,

    It seems that this formula won't work on my sheet.

  6. #6
    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: Formula to stop the counting based on date

    Maybe you mean this?

    =IF(C1=TODAY(),"",TODAY()-A1)

  7. #7
    Registered User
    Join Date
    05-02-2012
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Formula to stop the counting based on date

    Hi sorry to all, below should be the problem:

    I have cell A1 with a value of 4/3/2012 and cell B1 with a formula =TODAY()-A1

    So, cell B1 will continuously count the number of days that had elapsed(as of today B1=41) with reference from cell A1 fixed date

    Now, I want a formula on cell B1 that if I enter the current date in cell C1 then cell B1 will stop counting AND IT WILL REMAIN 41 if date will move forwards in my PC system..

    Somebody please help.

    Thanks.

  8. #8
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Formula to stop the counting based on date

    J
    It will have to be a combination od functions and VBA

    =DATEDIF(A1,TODAY(),"d")
    and
    Please Login or Register  to view this content.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  9. #9
    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: Formula to stop the counting based on date

    ..Then, maybe..

    =IF(C1=TODAY(),SUM(C1-1)-A1,TODAY()-A1)

  10. #10
    Registered User
    Join Date
    05-02-2012
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Formula to stop the counting based on date

    Hi Sir Fotis,

    I still having a problem with the formula, value was disappered. Kindly check the attachment.

    Thanks.

    j.
    Attached Files Attached Files

  11. #11
    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: Formula to stop the counting based on date

    Hi Joseph

    You didn't try my second suggestion..

    To work correctly the formula, needs in C Column to type the current date. NOT use =Today()

    Is this, works for you?
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    05-02-2012
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Formula to stop the counting based on date

    Hello again Sir Fotis,

    Yup I had tried that, I just wondered why instead of having it 41 days then why it became 40 days?

    Well, still I could not have to take a test on the formula cuz I can't change the date of my system to tomorrow's date as its lock by our admin. Then I have to wait for tomorrow and see if counting will continue or not

    Thanks a lot! I appreciate.

  13. #13
    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: Formula to stop the counting based on date

    You are welcome

    Take your time..

    Important is to type the date in C Column! Don't use = today()!!

    We have 40 days, because formula "says", that if C is Today(), then STOP count, YESTERDAY...

  14. #14
    Registered User
    Join Date
    05-02-2012
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Formula to stop the counting based on date

    Hi Sir Fotis,

    I have tried this at home now, and when I set my system's date forward column will still continue to count.

  15. #15
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Formula to stop the counting based on date

    It will have to be a combination od functions and VBA

  16. #16
    Registered User
    Join Date
    05-02-2012
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Formula to stop the counting based on date

    Hi Sir Pike,

    I had tried your formula but had no idea about VBA and I'm not educated about it. I tried opening the UI of VBA but I'm not really sure on how to do it correctly. Hope you can guide me.

    Thanks a lot!

  17. #17
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Formula to stop the counting based on date

    What was wrong with Dilipandey's solution? It assumes column C is empty until you put in a date, which seems reasonable. The problem is that 'today' is a moving target. Can you have the spreadsheet be:
    Column A: Your Start date
    Column B: Your count of days from start date to today or the date in column C (depending on whether C is populated or not)
    Column C: Your End date or blank

    To tie your formula to stop counting only if the value in column C is 'today' will only be true for that day.
    What would column C represent if not an end date?

    Pauley

  18. #18
    Registered User
    Join Date
    05-02-2012
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Formula to stop the counting based on date

    You are right Mr. Pauleyb. And now I just use this kind of formula on column B:

    =IF(ISNUMBER(C1),SUM((C1-1)-A1),TODAY()-A1))

    We can't really shoot a constantly moving target.

  19. #19
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Formula to stop the counting based on date

    It is possible if you use a Worksheet.Activate event

  20. #20
    Forum Contributor
    Join Date
    08-29-2011
    Location
    Atlanta
    MS-Off Ver
    Excel 2007
    Posts
    171

    Re: Formula to stop the counting based on date

    Try adding this into B2:
    =IF(ISNUMBER(C2),C2-A2,TODAY()-A2)

    If a date is entered into C2, the value in B2 remains constant at whatever C2-A2 is, otherwise B2 keeps counting.

    If you drag this down, B2 = 41 (and will stay at 41) and B3 = 43 (and B3 will keep changing each day)

    Just don't use =TODAY() as your value in column C - then your "constant" value will keep changing as well.
    Last edited by ATLGator; 05-16-2012 at 06:58 PM.

  21. #21
    Forum Contributor
    Join Date
    08-29-2011
    Location
    Atlanta
    MS-Off Ver
    Excel 2007
    Posts
    171

    Re: Formula to stop the counting based on date

    Or, if you want B2 to stop counting ONLY IF the date entered in C2 equals the current date at the time the date is entered, then try:
    =IF(C2=TODAY(),C2-A2,TODAY()-A2)

    Again, making sure not to use =TODAY() in column C

  22. #22
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Formula to stop the counting based on date

    Hi joseph_yap22,

    This may be what you want:

    Please Login or Register  to view this content.

    Oops! ATL Gator must have posted while I was thinking.

    Sorry for the duplication.
    Last edited by xladept; 05-16-2012 at 07:53 PM. Reason: Duplicated Previous Post
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  23. #23
    Registered User
    Join Date
    05-02-2012
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Formula to stop the counting based on date

    Thanks again Pike,ATLGator & xladept!star,star & star...

    We'll see then and try all your suggestions and we'll give you feedbacks. I thanked you all a lot!

  24. #24
    Registered User
    Join Date
    05-02-2012
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Formula to stop the counting based on date

    Hi! ALTGator & xladept...this formula won't work when I tried it. The counting on cell B2 still continues when the date moves forward.

  25. #25
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Formula to stop the counting based on date

    Is the workbook opened and closed?
    Or just left open?

  26. #26
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Formula to stop the counting based on date

    Hi joseph_yap22,

    If column C only gets posted upon completion then:

    Please Login or Register  to view this content.

  27. #27
    Registered User
    Join Date
    08-17-2013
    Location
    Nigerian
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Formula to stop the counting based on date

    please people in the house , help me, i need help plsssssssssssssssssssssssssssssssssss

    This is the question:
    i have a date that i supplied goods to a customer e.g 17/7/2013 in cell A1 (date supplied) and the total amount of the goods supplied in cell B1, which the customer has 30 days for the payment to expire, so i need a formula that will countdown each day(i.e from 30, 29, 27 ---------0 and it will bring out the amount as well (i.e 4 days remaining to paid up the value which is 2000). also i have a table in excel which goes like this: Name of Customer/ Amount Paid/ payment due date /0-5 days/6-20 days/21-40 day. so when the decrease fall on 6-20 days, the payment reminder should move to 6-20 day. When it reaches the deadline day, which is 30 days the reminder should move to payment due.

    Note: the countdown should always be automatic update without me opening my system always.
    Here is my attached format in excel sheet.

    Thanks
    Alli Adejumoke

  28. #28
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Formula to stop the counting based on date

    Adejumoke,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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