ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Reference an Operator from a cell with Sumproduct (https://www.excelbanter.com/excel-worksheet-functions/184739-reference-operator-cell-sumproduct.html)

Deeds

Reference an Operator from a cell with Sumproduct
 
I am trying to reference a cell which one could key in the operator i.e. = or
or < or = etc....


I want my sumproduct formula to reference this cell and use the operator
instead of hardcoding the symbol inside. Essentially I want to let the user
choose the operator within the sumproduct formula.

Thanks in advance.

ryguy7272

Reference an Operator from a cell with Sumproduct
 
Something like this (placed in E1, perhaps) may work for you:
=SUMPRODUCT(--(A1:A5=D1), --(B1:B5=10),--(C1:C5))

Also, this is a great resource for things pertaining to SUMPRODUCT:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

Regards,
Ryan--

--
RyGuy


"deeds" wrote:

I am trying to reference a cell which one could key in the operator i.e. = or
or < or = etc....


I want my sumproduct formula to reference this cell and use the operator
instead of hardcoding the symbol inside. Essentially I want to let the user
choose the operator within the sumproduct formula.

Thanks in advance.


Deeds

Reference an Operator from a cell with Sumproduct
 
However, I need the = sign in a different cell that the sumproduct
references. So, the end user can change the = to or < or = etc. I need a
cell where they can change the operator and have it pull into the sumproduct
formula. Thanks again.

"ryguy7272" wrote:

Something like this (placed in E1, perhaps) may work for you:
=SUMPRODUCT(--(A1:A5=D1), --(B1:B5=10),--(C1:C5))

Also, this is a great resource for things pertaining to SUMPRODUCT:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

Regards,
Ryan--

--
RyGuy


"deeds" wrote:

I am trying to reference a cell which one could key in the operator i.e. = or
or < or = etc....


I want my sumproduct formula to reference this cell and use the operator
instead of hardcoding the symbol inside. Essentially I want to let the user
choose the operator within the sumproduct formula.

Thanks in advance.


Spiky

Reference an Operator from a cell with Sumproduct
 
On Apr 23, 8:02 am, deeds wrote:
However, I need the = sign in a different cell that the sumproduct
references. So, the end user can change the = to or < or = etc. I need a
cell where they can change the operator and have it pull into the sumproduct
formula. Thanks again.

"ryguy7272" wrote:
Something like this (placed in E1, perhaps) may work for you:
=SUMPRODUCT(--(A1:A5=D1), --(B1:B5=10),--(C1:C5))


Also, this is a great resource for things pertaining to SUMPRODUCT:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html


Regards,
Ryan--


--
RyGuy


"deeds" wrote:


I am trying to reference a cell which one could key in the operator i.e. = or
or < or = etc....


I want my sumproduct formula to reference this cell and use the operator
instead of hardcoding the symbol inside. Essentially I want to let the user
choose the operator within the sumproduct formula.


Thanks in advance.


How many possible operators? You could just do a long series of IF
statements based on the contents of that cell if it isn't too many.
Perhaps use data validation on that cell to make it work properly.

Deeds

Reference an Operator from a cell with Sumproduct
 
Thanks! I ended up using if statements, it does get to be a cumbersome
formula. I really wish there were some way to have a user enter the operator
and have that cell be referenced from within sumproduct formula. Anwyways,
thanks for the help!

"Spiky" wrote:

On Apr 23, 8:02 am, deeds wrote:
However, I need the = sign in a different cell that the sumproduct
references. So, the end user can change the = to or < or = etc. I need a
cell where they can change the operator and have it pull into the sumproduct
formula. Thanks again.

"ryguy7272" wrote:
Something like this (placed in E1, perhaps) may work for you:
=SUMPRODUCT(--(A1:A5=D1), --(B1:B5=10),--(C1:C5))


Also, this is a great resource for things pertaining to SUMPRODUCT:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html


Regards,
Ryan--


--
RyGuy


"deeds" wrote:


I am trying to reference a cell which one could key in the operator i.e. = or
or < or = etc....


I want my sumproduct formula to reference this cell and use the operator
instead of hardcoding the symbol inside. Essentially I want to let the user
choose the operator within the sumproduct formula.


Thanks in advance.


How many possible operators? You could just do a long series of IF
statements based on the contents of that cell if it isn't too many.
Perhaps use data validation on that cell to make it work properly.



All times are GMT +1. The time now is 02:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com