Formula based on choice

RandyD123

Board Regular
Joined
Dec 4, 2013
Messages
200
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:

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

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
200

ADVERTISEMENT

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

RandyD123

Board Regular
Joined
Dec 4, 2013
Messages
200
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
200
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.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,659
Messages
5,838,642
Members
430,558
Latest member
Krampus

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