Formula based on choice

RandyD123

Board Regular
Joined
Dec 4, 2013
Messages
149
I have this in a cell:

=IF(Y16<>"Y",0,Z16-H16

MY default is "N" and if I don't change the Y/N cell to Y I want the formula to just subtract Z16-H16

N is in all the cells in the Y/N column by default.

How do I write the formula to just minus H16 from Z16 as a default and still have the formula work if I select "Y"?

I'm not sure if I need to provide more info or not?
 
Last edited:

Some videos you may like

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

jbeaucaire

Well-known Member
Joined
May 8, 2002
Messages
6,012
Just copy and paste the formula from this thread. Maybe you left the " " out from around the "N"?
 

RandyD123

Board Regular
Joined
Dec 4, 2013
Messages
149

ADVERTISEMENT

Yep, but now I lose my value when Y is selected!!!
 

RandyD123

Board Regular
Joined
Dec 4, 2013
Messages
149
I'm not sure why my original formula is not doing what is supposed to do and that is minus Z16 from H16 if Y is a N
 

jbeaucaire

Well-known Member
Joined
May 8, 2002
Messages
6,012

ADVERTISEMENT

Perhaps I misunderstand. What is supposed to happen for each of the two options?

Y = ?
N = ?
 

jbeaucaire

Well-known Member
Joined
May 8, 2002
Messages
6,012
When Y is entered, what should happen?

When N is entered, what should happen?
 

RandyD123

Board Regular
Joined
Dec 4, 2013
Messages
149
jbeaucaire....thanks for taking time to help. The more I look at the formula, it works as intended. As it turns out I just needed the Z16-H16!!! At least that's what I'm thinking at this point. I am going to try this for a few days and see if I'm all set.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,550
Messages
5,625,448
Members
416,107
Latest member
AVaes

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
Top