Excel dummy needing help with formula.

OCCY1221

New Member
Joined
Feb 1, 2023
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hi,
I am trying to write a simple formula for IF cell A3 says "YES" then the cell shows a result of (A1+A2)
and
IF the cell says "NO" then the cell shows a result of (A2-A1).
Im simple when it comes to excel so hoping this is an easy one for someone to help with here.
Thanks!
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hi,
I am trying to write a simple formula for IF cell A3 says "YES" then the cell shows a result of (A1+A2)
and
IF the cell says "NO" then the cell shows a result of (A2-A1).
Im simple when it comes to excel so hoping this is an easy one for someone to help with here.
Thanks!
Are "YES" and "NO" the only 2 possibilities?
 
Upvote 0
Book1
A
110
220
3YES
4
530
Sheet1
Cell Formulas
RangeFormula
A5A5=IF(A3="YES",A1+A2,A2-A1)


Book1
A
110
220
3NO
4
510
Sheet2
Cell Formulas
RangeFormula
A5A5=IF(A3="YES",A1+A2,A2-A1)
 
Upvote 0
Solution
While I'm learning.. is there a way then to turn the YES result to a colour? Say Green and No to Red?
 
Upvote 0
Conditional Formatting, something like this:

Book1
A
110
220
3YES
4
530
Sheet1
Cell Formulas
RangeFormula
A5A5=IF(A3="YES",A1+A2,A2-A1)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A3Cell Valuecontains "YES"textYES
A3Cell Valuenot containing "YES"textNO


Book1
A
110
220
3NO
4
510
Sheet2
Cell Formulas
RangeFormula
A5A5=IF(A3="YES",A1+A2,A2-A1)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A3Cell Valuecontains "YES"textYES
A3Cell Valuenot containing "YES"textNO


 
Upvote 0

Forum statistics

Threads
1,216,030
Messages
6,128,413
Members
449,449
Latest member
Quiet_Nectarine_

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top