HOW TO COMBINE SUMIF & INDIRECT FORMULA...sheets may or may not exist

JuicyMusic

Board Regular
Joined
Jun 13, 2020
Messages
210
Office Version
  1. 365
Platform
  1. Windows
Guru's, I woke up this morning and said I am going to combine SUMIF and INDIRECT by myself. Well, after floating around the internet and watching YT videos........not one formula worked. I get the NAME and REF error.

There is a Summary tab: Column A4:A34 = Date by day vertically, example 1/1/2023 and on.
Column B = sheet names of all the other tabs to the right of the Summary tab.....that may or may not be created after I run a VBA that creates these tabs IF their names are in this Column B.


How do you write a SUMIF formula on the Summary tab.......(with one criteria)........that is looking to sum data from the Column C of 30 or 31 sheets that may or may not exist?
Right now I have to link each day to each new sheet......28 times:(

Here is my SUMIF formula from the Summary tab in cell C4:
Excel Formula:
=SUMIF('HGI jan 1'!$A$2:$A$416,'HGI -Tax Recon'!C$3,'HGI jan 1'!$C$2:$C$416)

The cream-colored column is the column that a code I'm using looks at to create additional sheets from. If there are only 28 days in a month, then the code will create only 28 days.

Thank you and thank you in advance!!!!!
 

Attachments

  • Screenshot Summary tab_SUMIF.png
    Screenshot Summary tab_SUMIF.png
    20.3 KB · Views: 132
  • Screenshot EXAMPLE TAB OF THE 1ST DAY OF JAN FOR PROJECT NAMED HGI.png
    Screenshot EXAMPLE TAB OF THE 1ST DAY OF JAN FOR PROJECT NAMED HGI.png
    16.9 KB · Views: 128

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Hi,

Say, your sheet name is located in cell A1 : HGI jan 1

Then your formula could be
Excel Formula:
=SUMIF(INDIRECT("'"&A1&"'!"&"$A$2:$A$416"),'HGI -Tax Recon'!C$3,INDIRECT("'"&A1&"'!"&"$C$2:$C$416"))
Hope this will help
 
Upvote 0
Hi James, I tried it and I get a REF error. My SUMIF is summing line items from another sheet. Does this INDIRECT point to the other sheet....which is the 2nd snapshot?
Thank you so much.
 
Upvote 0
No sure to understand your remark ...

As explained above, if in cell A1 you store a sheet name, indirect("A1") will direct you to this sheet ... :)
 
Upvote 1
Solution
James006, please accept my aplogies for coming back late. It worked and TYSM!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top