Array Function Question

  • Thread starter Thread starter sunfish62
  • Start date Start date
S

sunfish62

I am new to these forums, but comfortable with Excel generally. I just
discovered the Array functions, and am trying to figure out why the
following calculation doesn't work:

{=IF(C20:C30="C",$A20:$A30, "")}

Basically, if the entry in one of the cells in C column has "C", I want
the corresponding cell from the A column. The formula works if the
*first* cell in the range is "C"; otherwise, it doesn't.

I am sure that this is a simple fix. Can someone fill me in?

TIA,
David
 
you need to
make your cell references absolute
enclose the condition with an OR (so that any "C" in the range )and
if you need corresponding values then select the range a20:a30 first and
type this formula
=IF(or(C$20:C$30="C"),$A20:$A30,"")
array entered
 
Thanks for the quick reply. When I make the change you suggest, I a
*always* given the value in the first row of the range. What I want i
to get the *corresponding* A column cell. So, if the 'C' is in row 23
give me A23
 
I figured out what feels like a kludge, but it works. Here it is:

=INDIRECT(CONCATENATE("A", 19 + MATCH("C", C$20:C$30, 0)))

The Match gives me the position in the search array. I add the base
position of the array to that, concatenate the result with the column I
want, and pull the contents from the cell identified by the string.

Maybe that'll help someone else.

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Formulas 2
Checkbox - Output results to a csv file 4
If & sumproduct formula with text 3
Excel VBA 1
Indirect function 8
Questions about copying a Formula 9
vlookup or index? 0
Sumproduct syntax question 6

Back
Top