+ Reply to Thread
Results 1 to 13 of 13

Count Number of Days

  1. #1
    Forum Contributor
    Join Date
    04-20-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    135

    Count Number of Days

    Hi

    Please help me with a fomula to calculate the "No of days' for Column C (the difference between column A and B) if column B is blank.

    Thank You

    Nancy
    Attached Files Attached Files

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Count Number of Days

    sorry the number of days to when,?
    maybe this
    =IF(B3="","",B3-A3+1)
    or this
    =IF(B3="",TODAY()-A3+1,B3-A3+1)
    Last edited by martindwilson; 10-06-2012 at 04:37 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Contributor
    Join Date
    04-20-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    135

    Re: Count Number of Days

    Hi

    C3=B3-A3
    In the instance, C3=1
    C5=B5-A5
    C5 should be 3

    Pl assist.

    Thanks

  4. #4
    Forum Contributor
    Join Date
    10-02-2012
    Location
    Bumi Nusantara
    MS-Off Ver
    Excel 2010; Excel 2016
    Posts
    136

    Re: Count Number of Days

    try this

    =IF(B3="",1,B3-A3+1)

    copy down

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Count Number of Days

    =if(b3="",1,b3-a3+1)

  6. #6
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Count Number of Days

    Hi

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I don't how you get 1 from B3-A3!

  7. #7
    Forum Contributor
    Join Date
    04-20-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    135

    Re: Count Number of Days

    Wow... "=if(b3="",1,b3-a3+1) " solve my problem.

    However, after I copy down the formula and if B8 & A8 are blank cells (no data yet), it also reflect "1".

    How can it reflect "0".

    Regards

  8. #8
    Forum Contributor
    Join Date
    10-02-2012
    Location
    Bumi Nusantara
    MS-Off Ver
    Excel 2010; Excel 2016
    Posts
    136

    Re: Count Number of Days

    then it must be

    =if(b3="",1,if((a3="")*(b3=""),0,b3-a3+1))
    Last edited by dwint; 10-06-2012 at 05:38 AM.

  9. #9
    Forum Contributor
    Join Date
    04-20-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    135

    Re: Count Number of Days

    Sorry, it cant work.
    Regards

  10. #10
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Count Number of Days

    =if(a3="","",if(b3="",1,b3-a3+1))

  11. #11
    Forum Contributor
    Join Date
    04-20-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    135

    Re: Count Number of Days

    Thanks. But after I add another column, the adjacent formula cannot work.

    Please help.

    Regards.

    Book1-1.xlsx

  12. #12
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Count Number of Days

    =if(a3="",0,if(b3="",1,b3-a3+1))

  13. #13
    Forum Contributor
    Join Date
    04-20-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    135

    Re: Count Number of Days

    Solved. Thanks.

    I really appreciate your great help.

    Regards

    Nancy

+ 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