hlookup & sumifs

vikishah

New Member
Joined
Oct 24, 2018
Messages
4
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.
Please advise. Thank you.
 

Eric W

MrExcel MVP
Joined
Aug 18, 2015
Messages
8,971
Try:

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

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet3

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

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 

vikishah

New Member
Joined
Oct 24, 2018
Messages
4
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
Joined
Aug 18, 2015
Messages
8,971
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?
 

Forum statistics

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

Some videos you may like

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...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top