+ Reply to Thread
Results 1 to 7 of 7

count amount based on today date

  1. #1
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    count amount based on today date

    Dear all,

    I have an excel sheet where I need to count some callback to clients per day. I made a button that will add everytime you click on it on a cell in the workbook. This should be taken in account and go to a different sheet where it should count all attempts from the whole team. Now I need to look at the end of the day on each team members sheet and past this data into the report. I was thinking of adding the date next to the cell with the amount when the button is clicked everytime to add 1 more to the number in the cell. Then the next step would be that the next day when pressing the button to add 1, it should search for a row with the date of today and then adding there the amounts. In this case there will be a formula at the bottom of the sheets that counts for that day the amounts found for that date. This is a way to automate the report in a much efficient way.
    I just miss the knoweledge to aply the vba.

    If some one could come with an idea how to make the button add 1 based on the day would be a great help.

    Thanks in advance
    Megatronixs
    Attached Files Attached Files

  2. #2
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: count amount based on today date

    Here is the code you are looking for I think
    This will sum the value of each cell that the date next to it is todays date so like this if value in the cell is 3 and the date next to it is todays date then the number will be 4
    If the cell is empty and the date next to it is todays date it will do nothing.
    And if the cell has a value and the date is tomorrows date or yesterdays date it will do nothing.
    replace your Add1 code with this one:
    Please Login or Register  to view this content.
    If you wish that if the cell has no value and the date next to it is the correct date to do a +1 then just remove the red part of the code.
    Hope this helps!

  3. #3
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: count amount based on today date

    Hello Stojko89,

    Thanks a lot for your fast answer. It is almost what I need ;-) It needs to find the first today's date in the row and then add 1+ (the cell in row will be empty)
    So in this case only 1 cell should add everty time 1 when we click the button. This way we can count how many atempts during the day. (the formula will look at the whole row with for that date, if all have an amount in the cells, it will just sum up all of it and come with an incorrect amount).

    Please let me know if I'm clear.

    Thank you again for your help ;-)

    Greetings,
    Megatronixs

  4. #4
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: count amount based on today date

    Oh thats what you want then it's a different code
    Please Login or Register  to view this content.
    So this finds the first date that is equal today in the column C and addes +1 to the cell next to it in column B.
    Hope this is what you need

  5. #5
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: count amount based on today date

    Hello Stojko89,

    you almost nailed it down ;-)
    The only thing is that it does not add one more when I press again the button. I tried to look at the code, but I can't figure it out.

    Great thanks again. And If I could press the star button again, I would ;-)

    Greetings,
    megatronixs

  6. #6
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: count amount based on today date

    Try this then
    Please Login or Register  to view this content.
    I saw I made a little mistake in the code befor I missed an "-" in the offset
    This should work fine now.

  7. #7
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: count amount based on today date

    I also added the If part for it to check if the date that it's searching for exists in the range or not.
    If it doesn't a msgbox will pop up if it does it will add a +1 to it

  8. #8
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: count amount based on today date

    Hello Stojko89,

    It works like magic ;-)
    Thanks a lot for your great help. I hope some one can learn from this as well.

    Greetings,
    megatronixs

+ 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