+ Reply to Thread
Results 1 to 10 of 10

Populate count & sum based on equal to & not equal to factors

  1. #1
    Forum Contributor
    Join Date
    02-21-2013
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2007
    Posts
    122

    Populate count & sum based on equal to & not equal to factors

    Please, please, please help this is the very last peice of a very large project.

    I need a macro that will pull the information from the register and enter next to the correct date the count in column F of the chargebacks tab & the sum of $$ in column G of the chargebacks tab.

    If the data on the register matches the following criteria I need it to put the total next to the correct date on the chargebacks tab.

    Column E = 6
    Column H = REFER, CLOSE, STOP, NSF
    Column A NOT = Z99999
    Attached Files Attached Files

  2. #2
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Populate count & sum based on equal to & not equal to factors

    Looks more like something that would be better handled with formulas.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Populate count & sum based on equal to & not equal to factors

    Try this for the count...
    =SUM(COUNTIFS(Register!D:D,[@Date],Register!E:E,6,Register!H:H,{"REFER","CLOSE","STOP","NSF"},Register!A:A,"<>Z99999"))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Populate count & sum based on equal to & not equal to factors

    Hi jscalem

    If the Formula approach works for you, fine.

    If not, try this...
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  5. #5
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Populate count & sum based on equal to & not equal to factors

    If you want a count
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Enter with Ctrl + Shift + Enter

    If you want the total from column E make a helper column U on the Register and enter this formula and fill down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Enter this formula for the sum
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  6. #6
    Forum Contributor
    Join Date
    02-21-2013
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2007
    Posts
    122

    Re: Populate count & sum based on equal to & not equal to factors

    I apologize but I forgot to mention that the data on the register will change regularly. So I will need it to enter in the data for the new dates each time the macro is run but not remove the previous dates data. This is why I need a macro instead of a formula.

    I have a large Macro that does everything else. This one thing I am having a hard time getting accomplished.

  7. #7
    Forum Contributor
    Join Date
    02-21-2013
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2007
    Posts
    122

    Re: Populate count & sum based on equal to & not equal to factors

    Quote Originally Posted by jaslake View Post
    Hi jscalem

    If the Formula approach works for you, fine.

    If not, try this...
    Please Login or Register  to view this content.
    This works PERFECT!!!! Thank you very very much!!!

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Populate count & sum based on equal to & not equal to factors

    You're welcome...glad I could help. Thanks for the Rep.

    If this resolves your issue please mark the Thread as Solved.

    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  9. #9
    Forum Contributor
    Join Date
    02-21-2013
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2007
    Posts
    122

    Re: Populate count & sum based on equal to & not equal to factors

    Quote Originally Posted by jaslake View Post
    You're welcome...glad I could help. Thanks for the Rep.

    If this resolves your issue please mark the Thread as Solved.

    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    So I thought this was solved however when I run the macro if there is nothing that matches this criteria it gives me a runtime error on the following line

    HTML Code: 

  10. #10
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Populate count & sum based on equal to & not equal to factors

    Hi jscalem

    Try this...
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. If a value is equal, populate the associate value
    By Sasti in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-02-2015, 03:59 PM
  2. Replies: 5
    Last Post: 04-19-2014, 10:09 PM
  3. [SOLVED] COUNTIFS function w/greater than or equal to, and less than or equal to time values
    By AliciaRenee in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-27-2014, 03:57 PM
  4. Scoresheet with Equal Ranks - need to identify equal placings separately
    By Caroleh in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-12-2014, 02:59 AM
  5. Replies: 3
    Last Post: 12-12-2012, 12:30 PM
  6. Replies: 0
    Last Post: 09-24-2010, 01:05 PM
  7. lower and upper case equal on spreadsheet but not equal in VB
    By don in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-12-2005, 09:06 PM

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