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
SUM formula across multiple worksheets
-
- StarLounger
- Posts: 94
- Joined: 16 Oct 2021, 16:22
SUM formula across multiple worksheets
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78474
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: SUM formula across multiple worksheets
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.
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 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
Hans
-
- StarLounger
- Posts: 94
- Joined: 16 Oct 2021, 16:22
Re: SUM formula across multiple worksheets
Hi Hans,
How do I create this range exactly? Do I just place this at the bottom of the YTD sheet?
How do I create this range exactly? Do I just place this at the bottom of the YTD sheet?
-
- Administrator
- Posts: 78474
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: SUM formula across multiple worksheets
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.
By naming the range, you don't have to worry in the formula where exactly it is located.
Best wishes,
Hans
Hans
-
- StarLounger
- Posts: 94
- Joined: 16 Oct 2021, 16:22
Re: SUM formula across multiple worksheets
I created the range and inserted the formula but I am getting a REF error?
-
- Administrator
- Posts: 78474
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: SUM formula across multiple worksheets
I'd have to see a small sample workbook demonstrating the error (it doesn't have to be your full workbook!)
Best wishes,
Hans
Hans
-
- StarLounger
- Posts: 94
- Joined: 16 Oct 2021, 16:22
Re: SUM formula across multiple worksheets
Think I fixed it, thanks again for your help Hans I appreciate it greatly.
Josh
Josh