easy Sumproduct giving value error

RockandGrohl

Well-known Member
Joined
Aug 1, 2018
Messages
819
Office Version
  1. 365
Platform
  1. Windows
Hello friends

I need to do some kind of sumproduct. The 'OPE' sheet that has the values has the project list in column A, and it has the GL codes across row 1 (starting from C1), with the values for each code & project as a matrix. The sum range is C2:AG863.

On the sheet which will have the formula, the project name is in cell C1, and the GL codes are found in A10:A31

I'm running with
Excel Formula:
=SUMPRODUCT((OPE!$A$2:$A$863=$C$1)*(OPE!$C$1:$AG$1=$A10)*OPE!$C$2:$AG$863)
which should be everything I need, according to this:


But it's giving a #value error.

Similiarly, a multi-criteria XLookup also fails with a value error.
Excel Formula:
=XLOOKUP(1,(OPE!A2:A863=C1)*(OPE!C1:AG1=A10),OPE!C2:AG863,"",0)

Can anyone help on this? The GL Code I'm looking up is a number (and I've verified both are numbers and not text)
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Most likely you have something in C2:AG863 that isn't a number or empty cell.
 
Upvote 0
Solution
Unless you have error values in OPE!A2:A863, OPE!C1:AG1,C1 or A10, I suspect that at least one of the cells you think is empty or a number is actually not what you think. A formula that returns "" for example, would cause a #VALUE! error.
 
Upvote 0
Unless you have error values in OPE!A2:A863, OPE!C1:AG1,C1 or A10, I suspect that at least one of the cells you think is empty or a number is actually not what you think. A formula that returns "" for example, would cause a #VALUE! error.
Hi Rory,

There's no errors anywhere on the sheet. Column A are strings. Row 1 from C:AG are numbers (and some are text, like some GL codes are numbers and some are words)

Could it be because on the formula sheet the GL codes are in A10:A31, so 21 items, but C:AG is 31 items? Shouldn't be the case because the formula is evaluating each GL code in isolation.
 
Upvote 0
Your formula is fine (I tested it).
Enter:
=COUNTA(OPE!C2:AG863)-COUNT(OPE!C2:AG863)
in a cell and see if it returns 0 or not.
 
Upvote 0
for what its worth, and to test my previous statement (which was wrong!). I entered:

Excel Formula:
=SUMPRODUCT((OPE!$A$2:$A$863=$C$1)*(OPE!$C$1:$AG$1=$A10)*OPE!$C$2:$AG$863)

In a new workbook in Cell A1 of Sheet1 and renamed another sheet OPE, no data anywhere. It returned 1.
 
Upvote 0
Your formula is fine (I tested it).
Enter:
=COUNTA(OPE!C2:AG863)-COUNT(OPE!C2:AG863)
in a cell and see if it returns 0 or not.
This returns £2150, can't see why it would return that as the array value is something like 46.5m across all cells.
 
Upvote 0
I used to use a Vlookup and manually entered the cells, but this isn't a good solution as there are more codes being added in every year which misaligns all the cells.
 
Upvote 0

Forum statistics

Threads
1,226,463
Messages
6,191,181
Members
453,645
Latest member
BOUCHOUATA

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top