CONCAT or INDIRECT not working for dynamic formula

bwinchell

New Member
Joined
Jul 19, 2016
Messages
15
Hello,
I have used the INDIRECT in a bunch of workbooks to dynamically create formulas based on 1 or multiple cells. Usually to reference a worksheet tab name based on date or function.

A3 = 10012015 (cell formatted as text as I need leading zeros)

E.g.
Code:
=COUNTIFS(INDIRECT("VM_Audit_"&$A3&"!"&"$A$2:$A$2000"),"<>"&"",INDIRECT("VM_Audit_"&$A3&"!"&"$I$2:$I$2000"),"BC_ESXi_CLUST*")

This will translate into and work fine
Code:
=COUNTIFS(VM_Audit_10012015!$A$2:$A$2000,"<>",VM_Audit_10012015!$I$2:$I$2000,"BC_ESXi_CLUST*")


I am trying to do something very similar to count distinctive occurrences of text. I have tried the CONCAT & INDIRECT in this formula but neither will work. It logically makes sense but something is breaking.

Static formula that works
Code:
{=SUM(IF(VM_Audit_10012015!$J2:$J2000<>"",1/COUNTIF(VM_Audit_10012015!$J2:$J2000,VM_Audit_10012015!$J2:$J2000),0))}

Dynamic formula that does not work. Returns a #VALUE error:
Code:
{=SUM(IF((CONCATENATE("'VM_Audit_",$A3,"'!","$J2:$J2000","<>","""")),1/COUNTIF(VM_Audit_10012015!$J2:$J2000,VM_Audit_10012015!$J2:$J2000),0))}

Dynamic formula that does not work. Returns a #REF error:
Code:
{=SUM(IF(INDIRECT("VM_Audit_"&$A3&"!"&"$J$2:$J$2000"&"<>"&""""),1/COUNTIF(VM_Audit_10012015!$J2:$J2000,VM_Audit_10012015!$J2:$J2000),0))}


Any suggestions or assistance? I am stuck on this one and cannot figure out why this not working.


PS
Is there any way to copy the text out of the "evaluate formula" window? It is too small and I cannot see exactly how many commas are being entered.

PSS
If there are any Excel developers looking at this, please make the window re-sizable or simple copy/paste functionality

Thanks
B
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Try...

Code:
=SUM(IF(INDIRECT("'VM_Audit_"&$A3&"'!$J2:$J2000")<>"",1/COUNTIF(INDIRECT("'VM_Audit_"&$A3&"'!$J2:$J2000"),INDIRECT("'VM_Audit_"&$A3&"'!$J2:$J2000"))))

...confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!
 
Last edited:
Upvote 0
Try...

Code:
=SUM(IF(INDIRECT("'VM_Audit_"&$A3&"'!$J2:$J2000")<>"",1/COUNTIF(INDIRECT("'VM_Audit_"&$A3&"'!$J2:$J2000"),INDIRECT("'VM_Audit_"&$A3&"'!$J2:$J2000"))))

...confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!


That worked.
Thanks
B
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,549
Members
449,089
Latest member
davidcom

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