Formula to include INDIRECT function

Ian Bell
Ian Bell used Ask the Experts™
on
Hi,
Could someone please modify the below formula or provide a new one. I may have placed the INDIRECT in the wrong place.

=SMALL(INDIRECT("AV"&P4&":AV"&Q4),INDEX(FREQUENCY(INDIRECT("AV"&P4&":AV"&Q4),0),1))

Assuming values are in cells P4 and Q4 and referring to values in column AV

Thanks

Ian
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Bill PrewTest your restores, not your backups...
Top Expert 2016

Commented:
I can't deduce what the correction might be with knowing what you are trying to do.  Can you provide a sample of the data and the desired results.

I typically break down longer formulas in a text editor when building them to help get parens and args in the proper place.  It looks like you haven't violated any of the parms, but hard to know if you have the right values in the right places without knowing the goal.

I broke your formula down as follows:

SMALL(
  INDIRECT("AV"&P4&":AV"&Q4),
  INDEX(
    FREQUENCY(
      INDIRECT("AV"&P4&":AV"&Q4),
      0
    ),
    1
  )
)

Open in new window


»bp
NorieAnalyst Assistant

Commented:
What is the formula meant to do and what do the values in P4 and Q4 represent?

PS Bill, I do something similar when working with long, complicated formulas by using ALT+ENTER in the Formula bar.
Ian Bellretired

Author

Commented:
I'm trying to find the minimum value in a range.
example
The minimum value in below range is 14
AV1  20
AV2  30
AV3  14
AV4   40
The ROW range is shown in cells   P4   1    Q4  4  (P4 & Q4 are only cells where data range is input.)
The formula looks up column AV and determines the smallest value
between rows AV1 and  AV4
Bill PrewTest your restores, not your backups...
Top Expert 2016

Commented:
Working based on cells in original formula, then maybe this?

=MIN(INDIRECT("AV"&P4&":AV"&Q4))

Open in new window


»bp
Ian Bellretired

Author

Commented:
Bill, sorry I forgot to add that I wanted to exclude zero values so I modified it to the following
=MIN(INDIRECT("AV"&P4&":AV"&Q4),">0")
but got a "VALUE" error
Test your restores, not your backups...
Top Expert 2016
Commented:
Okay, hence the use of SMALL, give this a try then:

=SMALL(INDIRECT("AV"&P4&":AV"&Q4),COUNTIF(INDIRECT("AV"&P4&":AV"&Q4),0)+1)

Open in new window


»bp
Ian Bellretired

Author

Commented:
Thanks Bill, You've excelled again
Ian
Bill PrewTest your restores, not your backups...
Top Expert 2016

Commented:
Welcome.


»bp

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial