Share via

SUMIF? and RIGHT()?

Anonymous
2024-10-26T14:07:29+00:00

Dearest Wizards,

A10-A1000 has city names followed by an underscore then the capitalized two-letter state designation (San Diego_CA).

Col B has numeric values associated with each city in Col A.

I want to put a two-letter state designator in cell C9 and have the sum total of the values in Col B that are associated with the cities that are in the states shown in Col A displayed in D9.

What formula do I use in D9?

TIA, Sam

Microsoft 365 and Office | Excel | Other | MacOS

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

6 answers

Sort by: Most helpful
  1. Anonymous
    2024-10-27T10:10:08+00:00

    Since the S_ is at the beginning, you should use

    =SUMIFS(B10:B1000, A10:A1000, "S_*")

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2024-10-27T01:41:16+00:00

    Hi,

    In cell D2, enter this formula

    =GROUPBY(TEXTAFTER(A2:A6,"_"),B2:B6,SUM)

    Hope this helps.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2024-10-27T01:36:56+00:00

    Hi Hans,

    This solution isn't working for me, BUT part of that may be on me and my original presentation. I'll try to come clean...

    Col A is actually a list of parts that may or may not have the prefix "S_" before the part name. Examples: S_wrench, S_Vise, S_Hammer, S_Screwdriver. My goal is to sum ONLY the values in Col B that are associated with a part name that is proceeded by "S_".

    I tried to modify your solution to: =SUMIFS(B10:B1000, A10:A1000, "*S_") which didn't work, then =SUMIFS(B10:B1000, A10:A1000, "*"&"S_"). Neither of these worked.

    FWIW Col A&B are results from an array -AND- Col A's format is "TEXT"

    Any other suggestions will be appreciated.

    Thanks,

    Sam

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2024-10-26T16:28:10+00:00

    Just a suggestion: For future reference you might consider using separate columns for City names & the state abbreviations.

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2024-10-26T14:33:21+00:00

    You can use SUMIF or SUMIFS:

    =SUMIFS(B10:B1000, A10:A1000, "*"&C9)

    Was this answer helpful?

    0 comments No comments