+ Reply to Thread
Results 1 to 14 of 14

Sumifs for two date range not working

  1. #1
    Registered User
    Join Date
    06-11-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2007
    Posts
    8

    Sumifs for two date range not working

    Hi, I am creating a macro using worksheet function sumifs.

    There are 3 col : brand name , purchase value & date.
    I need to extract sum of purchase value based on brand name and start & end date.My procedure is as below:
    Please Login or Register  to view this content.
    Is there anything that im missing out as the function is not giving me the result.
    Thanks in advance.

    Sheetal
    Last edited by arlu1201; 06-11-2012 at 02:50 AM. Reason: Use code tags in future.

  2. #2
    Registered User
    Join Date
    06-28-2011
    Location
    New Delhi India
    MS-Off Ver
    Excel 2003 ,2007
    Posts
    23

    Re: Sumifs for two date range not working

    Hi Sheetal, Just minor change of datatype will help you to run this program.


    Please Login or Register  to view this content.
    Purushottam
    Excel, MS ACCESS 2007

  3. #3
    Registered User
    Join Date
    06-11-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Sumifs for two date range not working

    Hi
    Thanks for the reply, but its not working.
    The purchase value still comes as zero.

    Thanks
    Sheetal

  4. #4
    Registered User
    Join Date
    06-28-2011
    Location
    New Delhi India
    MS-Off Ver
    Excel 2003 ,2007
    Posts
    23

    Re: Sumifs for two date range not working

    Can you please confirm where are you placing the code and Is your raw data and output are in different sheets? or if possible atttach you file
    Last edited by puru.sve; 06-11-2012 at 04:42 AM.

  5. #5
    Registered User
    Join Date
    06-11-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Sumifs for two date range not working

    Hi,

    Yes I am using 2 different sheets.
    The data is in sheet2 & output in sheet1

    Thanks
    Sheetal

  6. #6
    Registered User
    Join Date
    06-28-2011
    Location
    New Delhi India
    MS-Off Ver
    Excel 2003 ,2007
    Posts
    23

    Re: Sumifs for two date range not working

    Then it should work ..... it is working on my side.... .

  7. #7
    Registered User
    Join Date
    06-11-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Sumifs for two date range not working

    Hi,
    Im attaching my file maybe you could let me know where am i going wrong.

    Thanks in advance
    Sheetal
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    06-28-2011
    Location
    New Delhi India
    MS-Off Ver
    Excel 2003 ,2007
    Posts
    23

    Re: Sumifs for two date range not working

    Hi Sheetal

    Please try this code .. I just replaced the sumif because in your file the date has general format so it may have difficulties to read in date while running sumif function.

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    06-11-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Sumifs for two date range not working

    Hi,

    Thankyou !!! It works.

    Regards,
    Sheetal

  10. #10
    Registered User
    Join Date
    06-11-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Sumifs for two date range not working

    Hi,
    Need one more clarification on how to take the count. Should i use worksheet function outside the loop?

    Thanks
    Sheetal

  11. #11
    Registered User
    Join Date
    06-28-2011
    Location
    New Delhi India
    MS-Off Ver
    Excel 2003 ,2007
    Posts
    23

    Re: Sumifs for two date range not working

    Just take a counter see below in code

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    06-11-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Sumifs for two date range not working

    Thankyou so much for your time. its working.

    Just one more question.Does "Sheet2.Range("K" & i)" means the counter goes to next row?

    Regards,
    Sheetal

  13. #13
    Registered User
    Join Date
    06-28-2011
    Location
    New Delhi India
    MS-Off Ver
    Excel 2003 ,2007
    Posts
    23

    Re: Sumifs for two date range not working

    No , it just adding value in range("E3").... and if condition goes true then counter will increase by one so counter will give you the number of times condition met.

  14. #14
    Registered User
    Join Date
    06-11-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Sumifs for two date range not working

    Thanks

    Regards,
    Sheetal

+ 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