Excel - Dynamic row reference based on the row I paste a formula into?

Posted by michaelmichael on Super User See other posts from Super User or by michaelmichael
Published on 2011-01-17T21:31:33Z Indexed on 2011/01/17 22:55 UTC
Read the original article Hit count: 192

Filed under:
|

I have a simple, oft-used formula that I paste as plain text into spreadsheets I receive. It looks something like this:

=IF(D8="FOO", "BAR", "BAZ")

It looks in D8 for the word "FOO". If it finds it it will show "BAR". If it doesn't it will show "BAZ"

It works great. The problem is I have to paste this formula as plain text into many spreadsheets. It should ALWAYS look in column D for "FOO", however I don't always want it to look in row 8. I'd like it to look at whatever row I'm pasting it into.

For example, if I pasted the above formula into row 25, say, I would like it to automatically change to this:

=IF(D25="FOO", "BAR", "BAZ")

Is there any way to achieve this?

© Super User or respective owner

Related posts about excel

Related posts about spreadsheet