Share via

SUMIF with MID?

Anonymous
2019-06-24T20:14:50+00:00

I have an expression that doesn't work:

=IF(A10="","",SUMIF(C8:U8,UPPER(MID(C8:U8,1,4))="TEST",C10:U10))

My objective is to SUM that values in C10:U10 that correspond to a "TEST" in the first four (4) characters of the respective column cells of C8:U8.

Essentially, here's an example...

  Column =>                C                D                E              F             G               H   ....

Row 8                        Test01        Reck01      Test02     Reck2      Test03        Review03

Row 9....

Row 10                      92.5            14.6           86.1        8.9         76.8           -1.2

I just want the 92.5, 86.1 and 76.8, bolded and underlined in the above example, SUM'd and ignoring the other values.  I typically put the "=TEST" in the 'criteria' but this time I just want the first FOUR (4) characters (the "Test" or Upper("Test")=TEST and ignoring character positions 5 and above of their respective columns.

A10="" is a validation that data exists in the row so it's not important here relative to the SUMIF question.

Thoughts?

Thanks

Microsoft 365 and Office | Excel | For home | Windows

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

Answer accepted by question author

HansV 462.6K Reputation points
2019-06-24T21:15:08+00:00

Let's say you want to sum values where the cell in row 8 ends in "TEST". You'd use "*TEST" as condition.

Or you want to sum values where the cell in row 8 contains "TEST" in any position (start, middle, end). You'd use "*TEST*" as condition.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

Answer accepted by question author

HansV 462.6K Reputation points
2019-06-24T20:38:07+00:00

Try

=IF(A10="","",SUMIF(C8:U8,"TEST*",C10:U10))

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2019-06-25T01:48:58+00:00

    Let's say you want to sum values where the cell in row 8 ends in "TEST". You'd use "*TEST" as condition.

    Or you want to sum values where the cell in row 8 contains "TEST" in any position (start, middle, end). You'd use "*TEST*" as condition.

    THANKS!!

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2019-06-24T20:43:05+00:00

    Works... That was too easy... should have caught that!  

    Is there a way to use substrings and midstring searches with SUMIF/SUMIFS or and *IFS?

    Thanks!!

    Was this answer helpful?

    0 comments No comments