Indirect function

ELAINEMOK

New Member
Joined
Apr 9, 2015
Messages
16
I have a cell reference that varies. I tried to use the indirect function, but I keep receiving error message as volatile. Pl help!:(

This is my original formula (this formula is at worksheet2, worksheet1 is supposed to be left untouched as it is a copied worksheet from another workbook):
=SUMPRODUCT((worksheet1!A22:A2000<>"")/COUNTIF(worksheet1!A22:A2000,worksheet1!A22:A2000&""))-1

Now that A22 varies, depending on a cell value at worksheet1A$19. I tried using the indirect function:

Worksheet2!B12 = 22+A19 (number field)

=SUMPRODUCT((INDIRECT("worksheet1!A"&worksheet2!B12&":A2000")<>"")/COUNTIF(INDIRECT("worksheet1!A"&worksheet2!B12&":A2000"),INDIRECT("worksheet1!A"&worksheet2!B12&":A2000")&""))-1
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Apparently, we have a range in worksheet1, which is currently A22:A2000. This must be adjusted as n:A2000 where n is specified somewhere else. Where exactly?
 
Upvote 0
-1 because it happens that I need to subtract one from the unique count

I was curious why...

1. Assuming that the formula must be located in worksheet2...

=SUMPRODUCT((INDEX(worksheet1!A:A,B12):A2000<>"")/COUNTIF(INDEX(worksheet1!A:A,B12):A2000,INDEX(worksheet1!A:A,B12):A2000&""))-1

2. The following does the same, but faster. Control+shift+enter, not just enter:

=SUM(IF(FREQUENCY(IF(1-(INDEX(worksheet1!A:A,B12):A2000=""),MATCH(INDEX(worksheet1!A:A,B12):A2000,INDEX(worksheet1!A:A,B12):A2000,0)),MATCH(INDEX(worksheet1!A:A,B12):A2000,INDEX(worksheet1!A:A,B12):A2000,0),1))
 
Upvote 0
Hi
I received error message "too many arguments", not really sure on how to use the frequency function. Pl help
 
Upvote 0

Forum statistics

Threads
1,223,754
Messages
6,174,314
Members
452,554
Latest member
Louis1225

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