excel


Convert sumproduct formula into a generic formula that can be used across all sheets in a workbook


I have this formula where I want to convert it into a generic formula that reference to a sheet name in a cell
Current formula as below:
=SUMPRODUCT(('Data-2017'!W1:EZ1="Enemy 1")*('Data-2017'!W3:EZ1361="Yes")*('Data-2017'!J3:J1361=$T$4))
Where Data-2017 is the sheet name.
I have tried converting to following but failed:
=SUMPRODUCT(--(INDIRECT("'" & $D$3 & "'!" & "W1:EZ1=" & CHAR(34) & "Enemy 1" & CHAR(34))*("'" & $D$3 & "'!" & "W3:EZ1361=" & CHAR(34) & "Enemy 1" & CHAR(34))*("'" & $D$3 & "'!" & "J3:J1361=" & T4))
where D3 is the cell for sheet name, T4 is another value in to suffice the condition
Thanks in advanced
INDIRECT only goes around the cell references not the whole formula:
=SUMPRODUCT((INDIRECT("'" & $D$3 & "'!" & "W1:EZ1")="Enemy 1")*(INDIRECT("'" & $D$3 & "'!" & "W3:EZ1361")="Yes")*(INDIRECT("'" & $D$3 & "'!" & "J3:J1361")=$T$4))
I actually figured out by accident after further research, hope this will help others in the future:
=SUMPRODUCT((INDIRECT("'"&$D$3&"'!$W$1:$EZ$1")="Enemy 1")(INDIRECT("'"&$D$3&"'!$W$3:$EZ$1500")="Yes")(INDIRECT("'"&$D$3&"'!$J$3:$J$1500")=T$4))
Cheers

Related Links

How to edit column width of an Excel report which was created by an Access query?
i have a routine that saves specified sheets in a workbook to a pdf doc but if i make some of the sheets charts my routine falls over
Excel count distinct values in a date range by values
Excel, how to return a specific row from a data set
Count something based on another column
Nested macros not looping
Excel clipping data off long number before I can format it correctly
Excel: How to transfer names to numbers?
Computing the number of working hours in a week taking into account bank holidays in Excel
How to send a excel attachment in QCubed
Build Pivot Chart VBA
Pull Information from Webpage and Input into Cell
vba code to insert row and data in ascending order
Create 1 list in Excel from 2 other lists
Color specific excel cells based on match condition in python
Powershell+Export-Excel module

Categories

HOME
c++
node.js
machine-learning
loops
raster
encryption
hardware
import
jboss-eap-6
virtocommerce
bluetooth-lowenergy
google-cardboard
sorm
outlook-redemption
fix
watchkit
video.js
filenet-p8
ietf-netmod-yang
biopython
sdl
bit-manipulation
dht
eventtrigger
pad
clang-format
4d-database
react-boilerplate
google-app-invites
flip-flop
nattable
osx-elcapitan
revit
size-classes
biblatex
measurement
postgresql-8.3
inversifyjs
servicestack.redis
word
crawler4j
handbrake
google-optimize
bootstrapping
angularjs-ng-model
audiokit
oracle-data-modeler
envelope
fpu
c#-6.0
fancytree
falcor
pbs
lpc
ikvm
opscenter
lab-color-space
playstation
voxel
local-variables
plone-4.x
timedelta
pxe
highcharts-ng
httpful
octopress
cirqus
realbasic
yard
singularitygs
delphi-5
gstat
jison
mpmediapickercontroller
smslib
lastaccesstime
openni
treenode
compiler-options
cleartool
sql-job
spool
arbitrary-precision
typescript1.4
tokumx
fast-esp
duplicate-removal
textile
updatemodel
google-email-settings-api
node-http-proxy
wsimport
ereg
payflowlink
badimageformatexception
ipad-2
robohelp
visual-assist-x
static-array
springmockito
function-overloading
django-generic-views
windows-live-writer
httpverbs
installshield-2008
libjson

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile