# SUMIFS help

810 Views 3 Replies 2 Participants Last post by  lochlomonder
I need help coming up with an excel formula
I'm not sure if I need a SUMIF, SUMIFS or some other formula.

Each patient is assigned codes (B2:E2) and each code has a value (A5:B11). I need to add up the total value for each patient.
The example below only gives a total of one code (in C2). How can I get it to total the codes in B2, C2, D2, E2 all together?

#### Attachments

• 16.7 KB Views: 11
• 10 KB Views: 10
See less See more
3
Status
Not open for further replies.
1 - 4 of 4 Posts
Here's the formula to enter in G2:

Code:
``=SUM(VLOOKUP(B2,A6:B11,2,FALSE)+VLOOKUP(C2,A6:B11,2,FALSE)+VLOOKUP(D2,A6:B11,2,FALSE)+VLOOKUP(E2,A6:B11,2,FALSE))``
This will use individual vertical lookups on the left-most table and then sum the individual values. I did notice, however, I received an N/A error when testing this out, and the values in A7 and C2 weren't exactly the same, even though they look the same. I C&P'ed the value from the former to the latter and the code worked.
Wow that worked!!!!!

I never would have come up with that formula.

Thank You!
You're welcome

Can you please mark this thread as Solved? That way, it may help others looking for similar solutions.
1 - 4 of 4 Posts
Status
Not open for further replies.