Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • Understanding Anova in Excel
  • Move chart to a separate worksheet in Excel
  • Reverse List in Excel
  • How to calculate current stock or inventory in Excel
  • How to count table rows in Excel

References

  • Vlookup Examples in Excel
  • CHOOSE function: Description, Usage, Syntax, Examples and Explanation
  • How to get relative row numbers in a range in Excel
  • How to use Excel OFFSET function
  • How to retrieve first match between two ranges in Excel

Data Validations

  • Excel Data validation date in specific year
  • How To Create Drop-down List in Excel
  • Excel Data validation number multiple 100
  • Excel Data validation no punctuation
  • Excel Data validation require unique number

How to display conditional message with REPT function in Excel

by

To display a conditional message, without the IF function, you can use boolean logic and the REPT function.

Formula

=REPT("message",logical test)

Explanation

 In the example shown, the formula in D5 (copied down) is:

=REPT("low",C5<100)

If the value in column C is less than 100, the formula returns “low”. If not, the formula returns an empty string (“”), which looks like a blank cell.

How this formula works

This formula uses boolean logic to output a conditional message. If the value in column C is less than 100, the formula returns “low”. If not, the formula returns an empty string (“”).

Boolean logic is a technique of handling TRUE and FALSE values like 1 and 0. In cell C5, the formula is evaluated like this:

=REPT("low",C5<100)
=REPT("low",TRUE)
=REPT("low",1)
="low"

In other words, if C5 < 100, output “low” 1 time. In cell C6, the formula is evaluated like this:

=REPT("low",C6<100)
=REPT("low",FALSE)
=REPT("low",0)
=""

In other words, if C6 < 100 is FALSE, output “low” zero times.

IF function alternative

Conditional messages like this are more commonly handled with the IF function. With IF, the equivalent formula is:

=IF(C5<100,"low","")

Both formulas return exactly the same result, but the REPT version is a bit simpler.

Extending the logic

Boolean logic can be extended with simple math operations to handle more complex scenarios. Briefly, AND logic can be expressed with multiplication (*)  OR logic can be expressed with addition (+).  For example, to return “low” only when (count < 100) AND  (day = Monday) we can use boolean logic like this:

=REPT("low",(C5<100)*(B5="Monday"))

The equivalent IF formula is:

=IF(C5<100,IF(B5="Monday","low",""),"")

or, simplifying a bit with AND:

=IF(AND(C5<100,B5="Monday"),"low","")

Coercing TRUE and FALSE to 1 and zero

When using boolean logic, you’ll sometimes need to force Excel to coerce TRUE and FALSE to 1 and zero. A simple way to do this is to use a double-negative (–).

Post navigation

Previous Post:

DECIMAL function: Description, Usage, Syntax, Examples and Explanation

Next Post:

AVERAGE function: Description, Usage, Syntax, Examples and Explanation

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • IF function: Description, Usage, Syntax, Examples and Explanation
  • How to use Excel AND Function
  • IFS function: Description, Usage, Syntax, Examples and Explanation
  • Return blank if in Excel
  • How to use Excel TRUE Function

Date Time

  • Get fiscal quarter from date in Excel
  • How to calculate Day of the Year in Excel
  • Get days between dates ignoring years in Excel
  • Sum race time splits in Excel
  • Create date range from two dates in Excel

Grouping

  • Categorize text with keywords in Excel
  • Map inputs to arbitrary values in Excel
  • How to randomly assign people to groups in Excel
  • Group arbitrary text values in Excel
  • Group times into unequal buckets in Excel

General

  • Basic numeric sort formula in Excel
  • Zoom Worksheet in Excel
  • How to calculate total from percentage in Excel
  • AutoFit Column Width, AutoFit Row Height in Excel
  • Hide and Unhide Columns or Rows in Excel
© 2025 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning