ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Use cell content (example: ="a") in formula. (https://www.excelbanter.com/excel-worksheet-functions/454038-use-cell-content-example-%3D-formula.html)

R0nald

Use cell content (example: ="a") in formula.
 
Hello all,

How can I use the content of a cell as rule in a formula?

Exammple:

A2 has a
A3 has b
a4 has c
etc, etc.

Content of B1 is (as text): ="a"

I want to have a formula in b2 where the content of B2 is used to compare if A2 is ="a" (the content of B2)
So something like:
=IF(A2 & B1 & ;1;2)

it will have the same effect as =IF(A2="a";1;2) where the comparision with "a" is hardcoded.


Thanks in advance for any hint or help!


Auric__

Use cell content (example: ="a") in formula.
 
R0nald wrote:

How can I use the content of a cell as rule in a formula?

Exammple:

A2 has a
A3 has b
a4 has c
etc, etc.

Content of B1 is (as text): ="a"

I want to have a formula in b2 where the content of B2 is used to compare
if A2 is ="a" (the content of B2)
So something like:
=IF(A2 & B1 & ;1;2)

it will have the same effect as =IF(A2="a";1;2) where the comparision with
"a" is hardcoded.


So, something like this?

=IF(A2=B2,1,2)

--
Sometimes you wake up.
Sometimes the fall kills you.
And sometimes, when you fall, you fly.


All times are GMT +1. The time now is 06:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com