+ Reply to Thread
Results 1 to 6 of 6

Using sumifs when one condition is comparing an account number with dashes to a list

  1. #1
    Registered User
    Join Date
    07-30-2013
    Location
    Maryland
    MS-Off Ver
    365
    Posts
    11

    Using sumifs when one condition is comparing an account number with dashes to a list

    Hello,

    I'm trying to create a sumifs formula where one of the conditions is to compare the account number (in the form of xx-xx-xxx) to an acceptable list of accounts on a separate tab. Is this possible? I can't share the data, but here's the formula I'm trying to use:

    =SUM(SUMIFS('Data Current'!$D:$D,'Data Current'!$C:$C,Accts!B66:B131, 'Data Current'!$A:$A, "*" & $B3 & "*"))

    Data Current'!$C:$C is the account number of the record.
    Accts!B66:B131 is the list of accounts that are applicable.

    Everything else in the formula seems to work.

    Thanks!

  2. #2
    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,939

    Re: Using sumifs when one condition is comparing an account number with dashes to a list

    Hi, welcome to the forum

    1. does the account actually have - in it, or is it just formatted to show that?

    2. It looks to me like your syntax os a bit out there, too. Syntax should be...
    =sumifs(sum-range, criteria-range1, criteria1, criteria-range2, criteria2,....)
    criteria1 etc needs to be a single cell ref, not a range..

    Another possible way around this would be to add a helper, then use MATCH() to find the matching accounts, and sum based on that result
    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

  3. #3
    Forum Contributor
    Join Date
    11-05-2019
    Location
    Tiki Island, TX
    MS-Off Ver
    Office 365
    Posts
    168

    Re: Using sumifs when one condition is comparing an account number with dashes to a list

    I think in this case you probably need to separate the matching step from the other SUMIFS conditions. So IF(MATCH(),SUMIFS(),0)

  4. #4
    Registered User
    Join Date
    07-30-2013
    Location
    Maryland
    MS-Off Ver
    365
    Posts
    11

    Re: Using sumifs when one condition is comparing an account number with dashes to a list

    Thanks for the quick reply!

    To answer your questions:

    1. The accounts do have dashes in them.
    2. That's part of my question. Is it possible to sum the values for all of the accounts in the range? If not, what would be the least painful way to do this?

    Also, what do you mean by add a helper? I still have a lot to learn...

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,570

    Re: Using sumifs when one condition is comparing an account number with dashes to a list

    I would have suggested using SUMPRODUCT except for the inclusion of wildcards.
    A helper would be another column, presumably added to the 'Data Current' sheet, that in some manner finds matches between records in column A to "*" & $B3 & "*"
    You might then be able to write a SUMPRODUCT formula that uses the helper column.
    Something like =SUMPRODUCT(('Data Current'!$D:$D)*('Data Current'!$C:$C=Accts!B66:B131)*('Data Current'!$H:$H=TRUE))
    Note that in the above formula 'Data Current'!$H:$H is the helper column.
    It would be easier to help if we could see a completely fictionalized sample of data, set up as it is on the 'Data Current' and Accts sheets. If I understand correctly, we probably wouldn't need more than 10 rows of data on the 'Data Current' sheet and 2 rows on the Accts sheet. It would be helpful if you would tell us the expected result so we have something against which to compare our proposed formula/code results.
    To upload a sample follow the instructions in the fourth banner at the top of the page.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  6. #6
    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,939

    Re: Using sumifs when one condition is comparing an account number with dashes to a list

    As Jete pointed out, a helper column is just that - a column with a formula in it that helps you ID rows that you wish to include in further calcs.

    So for instance, in it's simplest form, you could have a formula that pulls out/ID's only those rows with an Acct number that you select. You then use that as the basis of a sum calc

+ 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. Replies: 1
    Last Post: 10-24-2018, 10:21 AM
  2. Help in using the SUMIFS for a Spreadsheet Checking Account
    By samy4excel in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 06-24-2016, 08:20 PM
  3. if Account number = return Account Name
    By mom2carisa in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 09-04-2013, 06:03 PM
  4. Return Account Nickname if Account Number Matches
    By spacle in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-03-2013, 11:04 AM
  5. [SOLVED] How to censor account numbers based on how many characters are in the account number
    By Mcorydon in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-25-2013, 01:06 PM
  6. Comparing data of two sheets-Pick an account number,
    By sriramkanala in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-09-2006, 10:59 AM
  7. [SOLVED] change dots to dashes in an account format (xx.xxxx.xxxx) to xx-xx
    By Michael in forum Excel General
    Replies: 1
    Last Post: 07-01-2005, 06:05 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