get a cell reference as a result of an If Function

C

coolistic

Hello
This is more complicated than it sounds. I need to do an If function to get
cell reference as a result... Let me give you my situation...

I have an if function that should go like this..

Pretend I am typing this function into cell B1

"If cell C1 is less than or equal to zero, then reference cell A1, if no
then add 1 to that to reference cell A2 instead.

That way cell B1 will either be referencing cell A1 or A2. But I need this t
b
in such a way that I can copy this function down hundreds of cells in the
column so that it will always continue to reference down the line to A3 the
A4
then A5... etc.... but it will only change when the cell in C column i
positive

Can anyone help? Thanks.
 
A

alanglloyd

Hello,
 This is more complicated than it sounds. I need to do an If function to get a
 cell reference as a result... Let me give you my situation....

 I have an if function that should go like this...

 Pretend I am typing this function into cell B1:

 "If cell C1 is less than or equal to zero, then reference cell A1, if not
 then add 1 to that to reference cell A2 instead."

 That way cell B1 will either be referencing cell A1 or A2. But I need this to
be
 in such a way that I can copy this function down hundreds of cells in the B
 column so that it will always continue to reference down the line to A3 then
A4,
 then A5... etc.... but it will only change when the cell in C column is
 positive.

If you mean that B1 will reference A1 or A2 depending on sign of C1
then B1 is

=IF(C1>0, A2, A1)

and drag the copy square down and B4 will be

=IF(C4>0,A5,A4)

OTOH if you mean that B4 should be =IF(C1>0,A5,A4) then having put the
same formula into B1, then click on the formula to position the cursor
between the C & 1, and press F4 once. The formula will then show B1 is

=IF($C$1>0, A2, A1)

Which means that the C & the 1 will not change as you copy-drag the
square down.

Pressing F4 repeatedly will change the formula to C$1, $C1, $C$1 and
then C1. In each case the dollar sign indicates that that part of the
formula will not change as you copy it.

But if you want something else then explain less ambiguously <g>.

Alan Lloyd
 

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

Top