CFLOGIC

CFLOGIC(Func_Num,Cell_Ref1,Cell_Ref2,Value)
Func_Num
Required. 1☛Blank, 2☛Not Blank, 3☛Number, 4☛Not Number, 5☛Text, 6☛Not Text, 7☛Logical, 8☛Not Logical, 9☛Error, 10☛Not Error, 11☛Formula, 12☛Not Formula, 13☛Odd, 14☛Even, 15☛Value Found (not case sensitive), 16☛Value Not Found (not case sensitive), 17☛Value Found (case sensitive), 18☛Value Not Found (case sensitive), 19☛Value Changes
Cell_Ref1
Required. Upper left most cell of conditional formatting range. Must be relative or mixed reference.
Cell_Ref2
Required for Number 19. Second cell reference to compare Offset from Ref1 by 1 row or column. Must be relative or mixed reference.
Value
Required for Numbers 15,16,17,18. Value to search for. Hardcoded or absolute/mixed reference.

CFLOGIC is used for Conditional Formatting and returns TRUE or FALSE given a function number (1-19) related to various logic and a cell reference.

schardt679

Board Regular
Joined
Mar 27, 2021
Messages
58
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
  2. Mobile
  3. Web
CFLOGIC is used for Conditional Formatting and returns TRUE or FALSE given a function number (1-19) related to various logic and a cell reference.

Excludes blanks (aside from Func 1,2) but not 0's. Functions are 1☛Blank, 2☛Not Blank, 3☛Number, 4☛Not Number, 5☛Text, 6☛Not Text, 7☛Logical, 8☛Not Logical, 9☛Error, 10☛Not Error, 11☛Formula, 12☛Not Formula, 13☛Odd, 14☛Even, 15☛Value Found (not case sensitive), 16☛Value Not Found (not case sensitive), 17☛Value Found (case sensitive), 18☛Value Not Found (case sensitive), 19☛Value Changes
Functions 15-18 use partial match functionality

Excel Formula:
=LAMBDA(Func_Num,Cell_Ref1,Cell_Ref2,Value,
      LET(Func, Func_Num,    Ref_1, Cell_Ref1,
             Ref_2, Cell_Ref2,    Val, Value,
             BL, Ref_1="",    BL_N, NOT(BL),
             NUM, ISNUMBER(Ref_1),    NUM_N, NOT(NUM),
             TXT, ISTEXT(Ref_1),    TXT_N, NOT(TXT),
             LOG, ISLOGICAL(Ref_1),    LOG_N, NOT(LOG),
             ERR, ISERROR(Ref_1),    ERR_N, NOT(ERR),
             CALC, ISFORMULA(Ref_1),    CALC_N, NOT(CALC),
             ODD, ISODD(Ref_1),    EVEN, ISEVEN(Ref_1),
             FND_NCS, ISNUMBER(SEARCH(Val, Ref_1)),    FND_NCS_N, NOT(FND_NCS),
             FND_CS, ISNUMBER(FIND(Val, Ref_1)),    FND_CS_N, NOT(FND_CS),
             VAL_CHG, AND(Ref_1<>Ref_2, Ref_2<>""),
             F1_10, SWITCH(Func,  1, BL,  2, BL_N,  3, NUM,  4, NUM_N,  5, TXT,  6, TXT_N,  7, LOG,  8, LOG_N,  9, ERR,  10, ERR_N,  0),
             F11_19, SWITCH(Func,  11, CALC,  12, CALC_N,  13, ODD,  14, EVEN,  15, FND_NCS,  16, FND_NCS_N,  17, FND_CS,  18, FND_CS_N,  19, CHG,  0),
             Result, IF(--(F1_10)=1, F1_10, F11_19),
             Return, IF(AND(Func>2, IFERROR(BL, 0)), 0, Result),
             Return
      )
  )

LAMBDA Examples.xlsx
ABCDEFGHIJ
1CFLOGIC
2
3Sample DataConditional Formatting Colors
4Is BlankNot BlankFunc_NumFunction
599991Is Blank (BL)
62Not Blank (BL_N)
7
88686
99393
10
117474
12
13
14Sample DataConditional Formatting Colors
15Is NumberNot NumberIs TextNot TextFunc_NumFunction
169191PatrickPatrick3Is Number (NUM)
17595987874Not Number (NUM_N)
18727275755Is Text (TXT)
19#N/A#N/A#N/A#N/A6Not Text (TXT_N)
20ABCABCABCABC
2160606060
2282828282
23
24
25Sample DataConditional Formatting Colors
26Is LogicalNot LogicalIs ErrorNot ErrorFunc_NumFunction
279191EFGEFG7Is Logical (LOG)
28TRUETRUE#VALUE!#VALUE!8Not Logical (LOG_N)
29ABCABCNoNo9Is Error (ERR)
30#N/A#N/A#N/A#N/A10Not Error (ERR_N)
31FALSEFALSE#CALC!#CALC!
32#VALUE!#VALUE!HIJHIJ
33TRUETRUE123123
34
35
36Sample DataConditional Formatting Colors
37Is FormulaNot FormulaIs OddIs EvenFunc_NumFunction
389191747411Is Formula (CALC)
39TRUETRUE969612Not Formula (CALC_N)
40FALSEFALSE717113Is Odd (ODD)
41#N/A#N/A848414IS Even (EVEN)
42TRUETRUE9393
4360609999
448282100100
45
46
47Sample DataConditional Formatting Colors
48Found (Not CS)Not Found (Not CS)Found (CS)Not Found (CS)Func_NumFunctionValue
49PittsburghPittsburghPittsburghPittsburgh15Found (Not CS) (FND_NCS)C
50OakdaleOakdaleOakdaleOakdale16Not Found (Not CS) (FND_NCS_N)C
51NewellNewellNewellNewell17Found (CS) (FND_CS)C
52Virginia BeachVirginia BeachVirginia BeachVirginia Beach18Not Found (CS) (FND_CS_N)C
53Deep CreekDeep CreekDeep CreekDeep Creek
54ClaringtonClaringtonClaringtonClarington
55Bonita SpringsBonita SpringsBonita SpringsBonita Springs
56
57*CS = Case Sensitive
58
59
60Sample DataConditional Formatting Colors
61DateProductUnits SoldFunc_NumFunction
6206/28/2021Product 19019Value Changes (VAL_CNG)
6306/28/2021Product 280
6406/28/2021Product 374
6506/29/2021Product 192
6606/29/2021Product 285
6706/30/2021Product 189
6806/30/2021Product 293
69
CFLOGIC
Cell Formulas
RangeFormula
B38B38=91
B40B40=2>3
B43B43=30*2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B5:B11Expression=CFLOGIC(1, B5,,)textNO
C5:C11Expression=CFLOGIC(2, C5,,)textNO
B16:B22Expression=CFLOGIC(3, B16,,)textNO
C16:C22Expression=CFLOGIC(4, C16,,)textNO
D16:D22Expression=CFLOGIC(5, D16,,)textNO
E16:E22Expression=CFLOGIC(6, E16,,)textNO
B27:B33Expression=CFLOGIC(7, B27,,)textNO
C27:C33Expression=CFLOGIC(8, C27,,)textNO
D27:D33Expression=CFLOGIC(9, D27,,)textNO
E27:E33Expression=CFLOGIC(10, E27,,)textNO
B38:B44Expression=CFLOGIC(11, B38,,)textNO
C38:C44Expression=CFLOGIC(12, C38,,)textNO
D38:D44Expression=CFLOGIC(13, D38,,)textNO
E38:E44Expression=CFLOGIC(14, E38,,)textNO
B49:B56Expression=CFLOGIC(15, B49,, $I$49)textNO
C49:C56Expression=CFLOGIC(16, C49,, $I$50)textNO
D49:D56Expression=CFLOGIC(17, D49,, $I$51)textNO
E49:E56Expression=CFLOGIC(18, E49,, $I$52)textNO
B62:D68Expression=CFLOGIC(19, $B62, $B63,)textNO
 
Upvote 0
When XL2BB copies the range it does not grab the border color and the border style. The section for function 19 - value changes should look like the attached picture. I had to use bold to show the change instead. It detects that there is a border but uses the default black solid line.
XL2BB Border Issue.JPG
 

Forum statistics

Threads
1,224,836
Messages
6,181,252
Members
453,028
Latest member
letswriteafairytale

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