Referencing a cell within SUMPRODUCT

askweklar

New Member
Joined
Sep 15, 2011
Messages
11
I am using the following formula: =(SUMPRODUCT(--(TRIM(All!$L$2:$L$10000)="Name"),--(TRIM(All!$M$2:$M$10000)="4"),--(TRIM(All!$J$2:$J$10000)="X")))/(SUMPRODUCT(--(TRIM(All!$L$2:$L$10000)="Name"),--(TRIM(All!$M$2:$M$10000)="4"))) It works, BUT I need to change the name "Name" and number "4" everyline - both of these can be found in a cell on the page - can this formula reference a cell so that I don't have to manually change 140 formulas? Clarify: the formula is pulling information from another page - on the page where the formula is found there is a column with individuals names in it, the formula is pulling from data to create percentages for those individuals. Rather than change the individual name for each individual in the list I'm *hoping* that the formula can just reference the cell with the name in it.

Thanks!
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Sure, the same as in any other formula:

=(SUMPRODUCT(--(TRIM(All!$L$2:$L$10000)=$A$1),--(TRIM(All!$M$2:$M$10000)=$B$1),--(TRIM(All!$J$2:$J$10000)="X")))/(SUMPRODUCT(--(TRIM(All!$L$2:$L$10000)=$A$1),--(TRIM(All!$M$2:$M$10000)=$B$1)))
 
Upvote 0
Thank you, I tried that - but it's not working... after I enter the cell the formula gives me an error saying that it's dividing by zero or blank cells.:confused:
 
Upvote 0
If the 2nd SUMPRODUCT returns a result of zero then you are dividing by zero....so #DIV/0! is a legitimate result in that case - or do you expect a non-zero result for that part of the formula?

Did you use the exact formula HP suggested?

Which version of Excel are you using?
 
Upvote 0
Yes, I tried the exact formula. I do not expect a return of zero. When I have the formula filled with the actual name and number rather referencing the cell with the name and number I get a return of 14%. I have 100 individuals to generate stats for and will have to change name and number twice within each formula... if I could avoid manually changing each formula that would be awesome!
 
Upvote 0
In your original formula you are using a number in quotes as the criteria ("4"). Those quotes mean that the number is text rather than numeric - if you are using a cell reference in its place then you should ensure that the cell used is formatted as text.....or enter like this

'4

Does that work?
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,730
Members
452,939
Latest member
WCrawford

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