Generic function applied to column?

  • Thread starter Thread starter noneya22
  • Start date Start date
N

noneya22

I'd like to know if there is a way to apply a function to a column that
will "execute" on each cell on that column. I have 3 columns where
columns A and B contain dates and I want the third column's cells to
display some text based upon the dates in it's respective cells on
columns A and B. So, I am trying to avoid going to every cell in
column C and entering a function such as: IF(A1 = B1, "Dates are
equal", "Dates are not equal"). In this scenario, I'd have to write a
similar function for rows 1, 2, 3, 4, etc. I'd like to write a
function such as (in pseudocode): IF(CurrentRowCell - 1 =
CurrentRowCell - 2, "Dates are equal", "Dates are not equal").

My goal is to write this generic function once and somehow make it
execute on column C. That way when any dates are changed on columns A
or B then the respective cell on column C would be automatically
updated. Is this possible?

I suppose another way to do this is to create a macro that I would have
to run (manually or based upon some event) that could iterate through
all the cells in columns A and B and update the respective cell in
column C.

Any help would be much appreciated.
 
What Topper writes is probably true, but if I understand what you want
to do it's really much easier than you think. Just make the formula one
time in row 1 and then copy and paste it to your other rows. Excel will
take care of adjusting the row references for you.

If you're putting the formula in Column C, it will be =IF(A1=B1,"Text
you want if TRUE","What you want if FALSE")
 

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

Back
Top