Available in:All versions (Works in Excel 2007, every later version, Microsoft 365 and Excel for the web)Examples need Excel 2024 or laterCategory:Logical

OR

OF in Dutch Excel

Returns TRUE when at least one of the conditions you give it is TRUE, and FALSE only when all of them are FALSE.

Difficulty rating 2 of 5. One TRUE is enough, which is quickly learned; combining OR with AND, and replacing it with addition in array formulas, is where people go wrong.

Last updated: 13 October 2026

See the worked examples

Sheet excerpt: D2 holds the formula
RowABCD
1Entry no.JournalAmountTest
225-0412MEM€1,250.00€ 1.250,00TRUETRUE=OR(B2="MEM", C2>=25000)=OR(B2="MEM"; C2>=25000)
325-0413VRK€18,400.00€ 18.400,00
425-0414INK€6,300.00€ 6.300,00
525-0415BNK€25,000.00€ 25.000,00
625-0416MEM€48,000.00€ 48.000,00
Formula cell (D2)Input

Result: TRUE

=OR(B2="MEM", C2>=25000)
=OR(B2="MEM"; C2>=25000)

What OR does and when to use it

What it does: it checks several conditions and returns TRUE when at least one holds, for example a journal line that is manual or above a threshold.

When to use it: whenever one of several reasons is enough, mostly as the test inside IF. Put OR inside AND when a rule mixes both. To test a value against a long list, COUNTIF or XMATCH works better than a long OR.

How Excel evaluates it

Excel evaluates every argument, left to right, even after it has found a TRUE. For each call:

  • each argument is reduced to TRUE or FALSE
  • arrays and ranges contribute every element, except empty cells and text, which are skipped
  • if at least one value is TRUE, OR returns TRUE; otherwise FALSE
  • an error in any argument makes the result that error, even when another argument is TRUE

Watch out: In formulas over whole ranges (FILTER, SUM over arrays), add the conditions instead of using OR, because OR returns one value for the whole range.

Mental model

Switches wired in parallel: any one switch that is on lights the lamp, and it only stays dark when every switch is off.

Terms used on this page: error value, array, argument, range, cell

OR(logical1, [logical2], ...)
OR(logical1; [logical2]; ...)
Arguments
ArgumentTypeMeaning
logical1RequiredThe first condition, usually a comparison such as B2>5000.
logical2OptionalMore conditions, up to 255 in total. One TRUE among them is enough.

Return value:TRUE if at least one condition is TRUE, otherwise FALSE

Formulas use commas (,) between arguments, as in English Excel. Formulas use semicolons (;) between arguments, as in Dutch Excel. Formulas use commas (,) between arguments, as in English Excel; Dutch Excel uses semicolons (;).

Worked examples

Beginner

Select journal lines for testing: manual or large

For journal entry testing you select every journal line that was posted manually (journal MEM) or that has an amount of 25,00025.000 or more. Either reason is enough. You want a TRUE or FALSE column next to the XAF export that picks out the lines to test.

Sheet excerpt: D2 holds the formula
RowABCDE
1Entry no.JournalAmountTest
225-0412MEM€1,250.00€ 1.250,00TRUETRUE=OR(B2="MEM", C2>=25000)=OR(B2="MEM"; C2>=25000)
325-0413VRK€18,400.00€ 18.400,00
425-0414INK€6,300.00€ 6.300,00
525-0415BNK€25,000.00€ 25.000,00
625-0416MEM€48,000.00€ 48.000,00
7
Formula cell (D2)Input

Formula in D2

=OR(B2="MEM", C2>=25000)
=OR(B2="MEM"; C2>=25000)

Result: TRUE

Step by step
  1. Excel evaluates logical1: B2 holds MEM, and "MEM"="MEM" is TRUE.
  2. It still evaluates logical2: C2 holds 1250, and 1250>=25000 is FALSE.
  3. One of the two is TRUE, so OR returns TRUE for entry 25-0412: a manual line, selected whatever its amount.
  4. Copied to D3: VRK is not MEM, and 18400>=25000 is FALSE, so FALSE. D4: INK and 6300 give FALSE as well.
  5. D5 holds exactly 25000 in a BNK line. The test uses >=, so 25000>=25000 is TRUE and the line is selected. D6 has two reasons (MEM and 48000) and still returns one TRUE.

Watch out: If your selection criterion says 'above 25,00025.000', the test must be C2>25000. With >= the line of exactly 25,00025.000 is selected as well, which changes the sample. Write the boundary down in your working paper.

More on this example: why it works

Why it works

OR only needs one TRUE among its arguments, so each criterion is an independent way to be selected. It does not count how many criteria hold, which is why 25-0416 with two reasons shows the same TRUE as 25-0412 with one.

Intermediate

Confirm receivables above a threshold or in dispute

You send a balance confirmation to every debtor whose balance reaches the threshold in G1, or whose balance is in dispute (TRUE in column C), and you skip the others. The formula is copied down the debtor list from the client's aging report. One balance came in from the export as text, and you want to see what that does.

Sheet excerpt: D2 holds the formula
RowABCDEFGH
1DebtorBalanceIn disputeActionConfirm from2500025000
2D1001€18,200.00€ 18.200,00FALSESkipSkip=IF(OR(B2>=$G$1, C2), "Confirm", "Skip")=IF(OR(B2>=$G$1; C2); "Confirm"; "Skip")
3D1002€31,500.00€ 31.500,00FALSE
4D1003€4,800.00€ 4.800,00TRUE
5D10049600FALSE
6D1005€25,000.00€ 25.000,00FALSE
7
Formula cell (D2)InputNote: B5 holds the text 9600, not the number: it sits on the left of the cell and shows a green triangle.

Formula in D2

=IF(OR(B2>=$G$1, C2), "Confirm", "Skip")
=IF(OR(B2>=$G$1; C2); "Confirm"; "Skip")

Result: Skip

Step by step
  1. Excel evaluates the OR first. logical1 is B2>=$G$1: 18200>=25000, which is FALSE.
  2. logical2 is C2, which holds FALSE: the balance is not in dispute. Both are FALSE, so OR returns FALSE.
  3. IF receives FALSE and returns value_if_false: Skip, for D1001.
  4. D3: 31500>=25000 is TRUE, so Confirm. D4: 4800>=25000 is FALSE, but C4 is TRUE, so Confirm again. Without the second argument, the disputed balance would not be confirmed.
  5. D5 compares the text 9600 with the number 25000. Excel does not convert here: in a comparison, any text counts as larger than any number, so "9600">=25000 is TRUE and a small balance is selected for confirmation.
  6. D6 has exactly 25000, and >= includes it, so Confirm. Change G1 to 18000 and D2 turns to Confirm as well, because 18200>=18000 is TRUE.

Watch out: The text balance in B5 produces the wrong answer without any error. Sort or filter the balance column: text values end up apart from the numbers, where they stand out.

More on this example: why it works, 1 more pitfall, 1 variation

Why it works

OR merges two independent reasons for a confirmation into one test, so IF only has two outcomes to choose from. The $ signs keep the threshold pointed at G1 in every copy, so you can change the threshold in one place.

More to watch out for

  • If a dispute cell is empty, OR skips it as a bare reference. Here that is harmless, because empty should mean 'not in dispute', but write C2=TRUE if empty must count as FALSE explicitly.

Variations

=IF(OR(B2 * 1 >= $G$1, C2), "Confirm", "Skip")
=IF(OR(B2 * 1 >= $G$1; C2); "Confirm"; "Skip")

Multiplying by 1 turns the text 9600 into the number 9600 before the comparison, so D1004 is skipped. A quick guard until the export is cleaned.

AdvancedExcel 2021 or later (This example needs Excel 2021 or later)

Journal lines for period 12: manual or above threshold

For journal entry testing you want a live list of the entries from the period in G1 that are either manual (journal G2) or above the amount in G3. The rule mixes AND (this period) with OR (either reason), and it has to work on the whole export at once, so both are written as arithmetic.

Sheet excerpt: G4 holds the formula
RowABCDEFGH
1Entry no.JournalAmountPeriodPeriod1212
225-0701MEM€3,500.00€ 3.500,001212Manual journalMEM
325-0702VRK€42,000.00€ 42.000,001212Amount above2000020000
425-0703MEM€61,000.00€ 61.000,001212Test25-0701=FILTER(A2:A8, (D2:D8=G1) * ((B2:B8=G2) + (C2:C8>G3)))=FILTER(A2:A8; (D2:D8=G1) * ((B2:B8=G2) + (C2:C8>G3)))
525-0704MEM€9,000.00€ 9.000,00111125-0702
625-0705INK€7,800.00€ 7.800,00121225-0703
725-0706BNK€20,000.00€ 20.000,001212
825-0707VRK€55,000.00€ 55.000,001111
9
Formula cell (G4)InputSpilled result

Formula in G4

=FILTER(A2:A8, (D2:D8=G1) * ((B2:B8=G2) + (C2:C8>G3)))
=FILTER(A2:A8; (D2:D8=G1) * ((B2:B8=G2) + (C2:C8>G3)))

Result: 25-0701 / 25-0702 / 25-070325-0701 / 25-0702 / 25-0703

Step by step
  1. Excel evaluates the innermost tests on all seven rows. B2:B8=G2 (MEM) gives TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE. C2:C8>G3 (above 20000) gives FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE.
  2. The + adds them row by row as 1s and 0s: 1+0, 0+1, 1+1, 1+0, 0+0, 0+0, 0+1, which is 1, 1, 2, 1, 0, 0, 1. Any row above 0 meets at least one reason: that is OR.
  3. D2:D8=G1 (period 12) gives 1, 1, 1, 0, 1, 1, 0. The * multiplies it with the OR result: 1, 1, 2, 0, 0, 0, 0. That is AND: the period test can switch a row off, whatever the other two said.
  4. FILTER keeps every row where the include value is not 0, so the 2 for 25-0703 counts as a keep in the same way as a 1. The list spills from G4 to G6: 25-0701, 25-0702, 25-0703.
  5. 25-0706 has exactly 20000 and 20000>20000 is FALSE, so it stays out. Change G3 to 5000 and 25-0705 (7800) and 25-0706 (20000) join the list, which then has five entries.

Watch out: Counting the same rule with SUM gives 4 instead of 3, because 25-0703 meets both reasons and contributes 2. Nothing errors, and your sample size is wrong. Compare the OR part with 0 first, as in the variation.

More on this example: why it works, 1 more pitfall, 1 variation

Why it works

Addition behaves like OR on 1s and 0s (the sum is above 0 when any term is 1), and multiplication behaves like AND (the product is 0 when any factor is 0). The brackets decide what is grouped with what, exactly as the words 'and either ... or' do in the selection rule. Both operators work per row, which OR and AND cannot.

More to watch out for

  • Writing OR(B2:B8=G2, C2:C8>G3) instead of the + gives one TRUE for the whole list. FILTER then receives one value for seven rows and returns #VALUE! or a wrong result, because the include argument needs one TRUE or FALSE per row.

Variations

=SUM((D2:D8=G1) * ((B2:B8=G2) + (C2:C8>G3) > 0))
=SUM((D2:D8=G1) * ((B2:B8=G2) + (C2:C8>G3) > 0))

Counts the entries to test: 3. The > 0 turns each 2 back into a single TRUE, so no row is counted twice.

MasterExcel 2024 or later (This example needs Excel 2024 or later)

Flag unusual postings against a watch list of accounts

In the XAF export you flag a journal line when at least one of these is true:

  • its account is on a watch list
  • the amount is above 100,000100.000
  • it is posted in a period after 12 (an adjustment period after year end)

The watch list lives in F2:F4 and changes now and then. You want one formula that returns TRUE or FALSE for every line, and changing an account on the list must not require editing it.

Sheet excerpt: E2 holds the formula
RowABCDEFG
1Entry no.AccountAmountPeriodFlagWatch list
225-080140004000€4,200.00€ 4.200,001111FALSE=LET( watch, F2:F4, MAP(B2:B6, C2:C6, D2:D6, LAMBDA(account, amt, period, OR(account = watch, amt > 100000, period > 12) )) )=LET( watch; F2:F4; MAP(B2:B6; C2:C6; D2:D6; LAMBDA(account; amt; period; OR(account = watch; amt > 100000; period > 12) )) )18001800
325-080218001800€1,800.00€ 1.800,001212TRUE19901990
425-080380008000€125,000.00€ 125.000,001212TRUE49904990
525-080445004500€3,000.00€ 3.000,001313TRUE
625-080516001600€98,500.00€ 98.500,001212FALSE
7
Formula cell (E2)InputSpilled result

Formula in E2

=LET(
  watch, F2:F4,
  MAP(B2:B6, C2:C6, D2:D6, LAMBDA(account, amt, period,
    OR(account = watch, amt > 100000, period > 12)
  ))
)
=LET(
  watch; F2:F4;
  MAP(B2:B6; C2:C6; D2:D6; LAMBDA(account; amt; period;
    OR(account = watch; amt > 100000; period > 12)
  ))
)

Result: FALSE / TRUE / TRUE / TRUE / FALSEFALSE / TRUE / TRUE / TRUE / FALSE

Step by step
  1. LET names the watch list: watch is F2:F4, holding accounts 1800, 1990 and 4990.
  2. MAP walks down B2:B6, C2:C6 and D2:D6 in step and calls the LAMBDA once per line. The first call gets account 4000, amt 4200 and period 11.
  3. account = watch compares 4000 with all three list entries and gives an array: FALSE, FALSE, FALSE. OR accepts that array as one argument and looks at each element.
  4. The other two tests are 4200 > 100000 FALSE and 11 > 12 FALSE. OR finds no TRUE among the five values and returns FALSE for 25-0801.
  5. 25-0802: 1800 = watch gives TRUE, FALSE, FALSE, so TRUE. 25-0803: 125000 > 100000 is TRUE. 25-0804: period 13 > 12 is TRUE. 25-0805 misses all three (account 1600, 98500, period 12), so FALSE.
  6. MAP collects the five answers and spills them from E2 to E6: FALSE, TRUE, TRUE, TRUE, FALSE. Type 1600 over 4990 in F4 and E6 turns TRUE without touching the formula.

Watch out: The mirror-image mistake is writing AND where OR is meant. AND(account = watch, ...) needs the account to equal all three list entries at once, which is impossible, so every line returns FALSE and nothing gets flagged.

More on this example: why it works, 2 more pitfalls, 1 variation

Why it works

OR reads every element of an array argument, so account = watch turns a list lookup into a single OR argument: any match makes the whole test TRUE. MAP gives each line its own call, so OR, which always returns one value, answers per row.

Do not use this construction on a full XAF export: a LAMBDA per row is slow on hundreds of thousands of journal lines. The alternative is ISNUMBER(XMATCH(...)) with added conditions, shown below, which is faster and needs no LAMBDA, at the cost of being harder to read and to extend.

More to watch out for

  • OR(B2:B6 = watch, ...) without MAP compares a column of 5 with a list of 3. The two missing positions become #N/A, and OR returns #N/A for everything.
  • An empty cell in the watch list compares equal to an empty account cell, so a line with no account is flagged. That is usually what you want, but know why it happens.

Variations

=ISNUMBER(XMATCH(B2:B6, F2:F4)) + (C2:C6 > 100000) + (D2:D6 > 12) > 0
=ISNUMBER(XMATCH(B2:B6; F2:F4)) + (C2:C6 > 100000) + (D2:D6 > 12) > 0

The same rule without LAMBDA: XMATCH finds each account in the list or returns #N/A, ISNUMBER turns that into TRUE or FALSE, and the additions are the OR. Prefer it for large volumes.

Common mistakes

Common mistakes
SymptomCauseFix
#VALUE! after a bare text argumentOR(B2="North", "South") returns #VALUE!.Every argument must be a full condition. Write OR(B2="North", B2="South"), or compare against a list: OR(B2 = F2:F3) (in Excel 2019 and earlier, confirm that with Ctrl+Shift+Enter).
Count higher than the matching rowsA count built from (condition1) + (condition2) is higher than the number of rows that qualify.A row that meets both conditions adds up to 2. Compare the sum with 0, ((condition1) + (condition2)) > 0, before counting.
FILTER gives #VALUE! or wrong rowsFILTER returns #VALUE! or a wrong result when you use OR as the include argument.The include argument needs one TRUE or FALSE per row. Add the conditions with +, so each row keeps its own result.
The rule finds far too few ticketsAND(B2="IT", C2>10, D2="High") was meant as 'IT, and either old or high priority', and misses most tickets.Group the alternatives in their own OR: AND(B2="IT", OR(C2>10, D2="High")).

Used in combinations