Copilot for Microsoft 365 Tech Accelerator
Feb 28 2024 07:00 AM - Feb 29 2024 10:30 AM (PST)
Microsoft Tech Community

Excel range

Copper Contributor

I am trying to perform the following sumif using variables for the ranges; this works

=SUMIF(E2394:E2614,E2839,A2394:A2614)

with 2394 in C2839 and 2614 in D2839, I am trying to do

=SUMIF("E"&C2839&":E"&D2839,E2839,"A"&C2839&":A"&D2839)

and this does not work nor does

=SUMIF(RANGE("E"&C2839&":E"&D2839),E2839,RANGE("A"&C2839&":A"&D2839))

 

how do I do this?

1 Reply

You can use the INDIRECT function. It converts a text string to the corresponding range:

 

=SUMIF(INDIRECT("E"&C2839&":E"&D2839),E2839,INDIRECT("A"&C2839&":A"&D2839))