Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Adjust one cell by a formula in another

0

Let A1 be 1234

let B1 = 5678

let c1 formula be: " change A1 to 'ok', if b1  = 5678

Answer
Discuss

Answers

0
Selected Answer

No formula can change the value in another cell.

Or, put differently, a formula can only display its result in the cell in which it resides. Therefore, if you wish to show different results in A1 depending upon the value of another cell the formula must reside in A1.

Let C1 = 1234.
Let B1 = 5678
[A1] = IF(B1=5678,"ok",C1)

The above would do the job provided that you can arrange your data entry in such a way as to make entering 1234 in C1 logical. That isn't normally the case. Therefore my own tendency would be to use VBA. However, coming to think of it, I haven't had that problem in a long, long time. I guess I just design my worksheets differently now, such as, letting A1 be 1234 (or whatever) and placing the "OK" in the column next to it.

Discuss

Discussion

Var...looks like your first line says it all..no can do.
thanks.
acorn (rep: 2) Dec 5, '18 at 7:40 pm
Can do! Want VBA?
Variatus (rep: 4889) Dec 5, '18 at 7:43 pm
Add to Discussion
0

Try:

=IF(B1=5678,"ok",,1234)

Put that formula into cell A1

Discuss

Discussion

thanks Don, but the formula should reside in C1.
Also your formula is wrong..too many commas.
acorn (rep: 2) Dec 5, '18 at 3:08 pm
Add to Discussion


Answer the Question

You must create an account to use the forum. Create an Account or Login