SUM formula across multiple worksheets

JDeMaro22
StarLounger
Posts: 94
Joined: 16 Oct 2021, 16:22

SUM formula across multiple worksheets

Post by JDeMaro22 »

Hi,

I am looking for a more convenient and risk free formula that will sum all of a doctors patient counts through multiple worksheets in the same workbook. As shown in my screenshot the "YTD" tab is currently just using the cell number as a reference for each doctor which can cause problems if a doctor is removed, moved or added. I am looking for a better formula to sum all of their results using the "NPI" unique identifier in column E.

Thank you,

Josh
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78474
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: SUM formula across multiple worksheets

Post by HansV »

One way to do this is to create a list of the worksheet names involved in a range of cells. Name this range - for example - Sheets.

S1107.png

You can then use the following formula in G11:

=SUMPRODUCT(SUMIF(INDIRECT("'"&Sheets&"'!E11:E200"),E11,INDIRECT("'"&Sheets&"'!G11:G200")))

Adjust the ranges if needed. Then fill down.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

JDeMaro22
StarLounger
Posts: 94
Joined: 16 Oct 2021, 16:22

Re: SUM formula across multiple worksheets

Post by JDeMaro22 »

Hi Hans,

How do I create this range exactly? Do I just place this at the bottom of the YTD sheet?

User avatar
HansV
Administrator
Posts: 78474
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: SUM formula across multiple worksheets

Post by HansV »

Wherever you like - somewhere out of the way on the YTD sheet, or on a separate sheet.
By naming the range, you don't have to worry in the formula where exactly it is located.
Best wishes,
Hans

JDeMaro22
StarLounger
Posts: 94
Joined: 16 Oct 2021, 16:22

Re: SUM formula across multiple worksheets

Post by JDeMaro22 »

I created the range and inserted the formula but I am getting a REF error?

User avatar
HansV
Administrator
Posts: 78474
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: SUM formula across multiple worksheets

Post by HansV »

I'd have to see a small sample workbook demonstrating the error (it doesn't have to be your full workbook!)
Best wishes,
Hans

JDeMaro22
StarLounger
Posts: 94
Joined: 16 Oct 2021, 16:22

Re: SUM formula across multiple worksheets

Post by JDeMaro22 »

Think I fixed it, thanks again for your help Hans I appreciate it greatly.

Josh