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
 
Hi
I received error message "too many arguments", not really sure on how to use the frequency function. Pl help

Sorry about that...

1. Just enter in say C12 of wokshhet2...

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

2. Control+shift+enter in say C12 of wokshhet2...

=SUM(IF(FREQUENCY(IF(1-(INDEX(worksheet1!A:A,B12):worksheet1!A2000=""),MATCH(INDEX(worksheet1!A:A,B12):worksheet1!A2000,INDEX(worksheet1!A:A,B12):worksheet1!A2000,0)),MATCH(INDEX(worksheet1!A:A,B12):worksheet1!A2000,INDEX( worksheet1!A:A,B12):worksheet1!A2000,0)),1))-1
 
Upvote 0

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,216,588
Messages
6,131,589
Members
449,657
Latest member
Timber5

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