# hlookup & sumifs

#### vikishah

##### New Member
Hello,
My file has company codes(CoCd) in col's and Profit centers(PC) in rows, with \$'s assigned to them. I need to retrieve \$'s specific to a PC and CoCd combination. Issue is sometimes same CoCds are in multiple columns. So can't do a simple sumif or Hlookup.

E.g.
B30 PC0001
B31 PC0002
B32 PC0003

C29 CoCd1
D29 CoCd2
E29 CoCd1
F20 CoCd3

I need to get the \$'s that are assigned to a combination of PC/CoCd.

#### Eric W

##### MrExcel MVP
Try:

ABCDEF
26PCPC0002
27CoCdCoCd1
28Total10
29CoCd1CoCd2CoCd1CoCd3
30PC000114710
31PC000225
8
11
32PC000336912

</tbody>
Sheet3

Worksheet Formulas
CellFormula
B28=SUMPRODUCT(C30:F32*(B30:B32=B26)*(C29:F29=B27))

</tbody>

<tbody>
</tbody>

#### vikishah

##### New Member
Thank you Eric. But I am getting an N/A using SUMPRODUCT(C30:F32*(B30:B32=B26)*(C29:F29=B27)).
Am I missing something?

Try:

ABCDEF
26PCPC0002
27CoCdCoCd1
28Total10
29CoCd1CoCd2CoCd1CoCd3
30PC000114710
31PC000225811
32PC000336912

<tbody>
</tbody>
Sheet3

Worksheet Formulas
CellFormula
B28=SUMPRODUCT(C30:F32*(B30:B32=B26)*(C29:F29=B27))

<tbody>
</tbody>

<tbody>
</tbody>

#### Eric W

##### MrExcel MVP
I'm not sure what to tell you. I get a 0 if one of the values in B26:B27 don't match, and a #VALUE if I put non-numeric data in the table somewhere. Blank entries are OK. I can't create a #N/A. Make sure that your ranges are correct, and that there's valid data in your ranges. Make sure that the formula is written properly. What version of Excel are you using?

1,081,860
Messages
5,361,737
Members
400,653
Latest member

### This Week's Hot Topics

• populate from drop list with multiple tables
Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
• Find list of words from sheet2 in sheet1 before a comma and extract text vba
Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
• Dynamic Formula entry - VBA code sought
Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...