IFYESNO

IFYESNO(Array,[Value_if_Yes],[Value_If_No])
Array
Required. Range to check for Yes's & No's.
[Value_If_Yes]
Optional. Value to return for Yes cells; ignored=1.
[Value_If_No]
Optional. Value to return for No cells; ignored=0.

IFYESNO is like IFERROR for Yes and No. It returns Value_If_Yes for Yes cells, Value_If_No for No cells, and the array itself otherwise. Uses ISOMITTED!

schardt679

Board Regular
Joined
Mar 27, 2021
Messages
58
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
  2. Mobile
  3. Web
IFYESNO is like IFERROR for Yes and No. It returns Value_If_Yes for Yes cells, Value_If_No for No cells, and the array itself otherwise. Uses ISOMITTED!

I found a good use for ISOMITTED. Use it if you want a default value other than an empty string or 0 for an argument.
This works because ISOMITTED treats empty strings, empty references, and 0s differently than missing values.
If Value_If_Yes or Value_If_No reference an empty cell, 0 is returned. To return an empty string, attach &"" to the reference.
This is exactly how IFERROR's Value_If_Error works too. If Value_If_Yes or Value_If_No are omitted, 1 or 0 are used respectively.
If skipping arguments, a comma is required. Calls IFBLANK.
Other functions on minisheet: AFORMULATEXT.

Screen Tip/ Comment: =IFYESNO(Array☛ range to check for Yes's & No's, [Value_If_Yes]☛ value to return for Yes cells; ❎=1✅, [Value_If_No]☛ value to return for No cells; ❎=0✅) ⁂[]=optional; ✅=default; ❎=omit

Excel Formula:
=LAMBDA(Array,[Value_If_Yes],[Value_If_No],
      LET(Arr, IFBLANK(Array, ""),          Yes, Value_If_Yes,          No, Value_If_No,
             Result, IF(Arr="YES", IF(ISOMITTED(Yes), 1,  Yes),  Arr),
             Return, IF(Result="NO", No,  Result),
             Return
      )
  )
LAMBDA Examples.xlsx
ABCDEFGHIJ
1IFYESNO
2
3Original DataValue_If_Yes:Result
4ProductOrdered?Value_If_No:Ordered?Total Orders
5Pepper DeseederYes15
6Knife SetNo0
7Cutting BoardYES1
8Peeler
9SpatulaNO0
10Meat TenderizerYEs1
11Cast Iron 5-piece Set11
12Serving Platter00
13Dinnerware 16-piece Setyes1
14
15Formula in cell H5☛ =IFYESNO(C5:C13)
16
17
18
19Original DataValue_If_Yes:GoodResult
20Question 1Question 2Value_If_No:BadQuestion 1Question 2
21YesNoGoodBad
22NonOBadBad
23NOyeSBadGood
24YESGood
25#N/Ayes#N/AGood
26
27Formula in cell H21☛ =IFYESNO(B21:C25, F19, F20)
28
29
30
31Original DataValue_If_Yes:0Result
32Question 1Question 2Value_If_No:1Question 1Question 2
33YesNo01
34NonO11
35NOyeS10
36YESYeS00
37noyes10
38
39Acting like NOT for TRUE/FALSE
40Formula in cell H33☛ =IFYESNO(B33:C37, F31, F32)
41
IFYESNO
Cell Formulas
RangeFormula
H5:H13H5=IFYESNO(C5:C13)
I5I5=SUM(H5#)
B15B15=AFORMULATEXT(H5)
H21:I25,H33:I37H21=IFYESNO(B21:C25, F19, F20)
B27B27=AFORMULATEXT(H21)
B40B40=AFORMULATEXT(H33)
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,109
Members
452,302
Latest member
TaMere

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