XL97: REPT Function Limited to 32,767 Characters

Last reviewed: February 18, 1998
Article ID: Q156841
The information in this article applies to:
  • Microsoft Excel 97 for Windows

SUMMARY

In Microsoft Excel 97, the REPT function can return a string with a maximum length of 32,767 characters. If the length of the string that is returned by the REPT function exceeds 32,767 characters, the function returns a #VALUE! error.

Also, note that the Help topic for the REPT function contains the following sentence:

   The result of the REPT function cannot be longer than 255
   characters.

This information is incorrect. The result cannot be longer than 32,767 characters.

MORE INFORMATION

In Microsoft Excel, the REPT function allows you to fill a cell with a sequence of characters that is repeated a specific number of times. For example, sample formulas that use the REPT function are listed in the following table.

   Formula              Result
   ------------------------------------

   =REPT("x",15)        xxxxxxxxxxxxxxx
   =REPT("dog",3)       dogdogdog
   =REPT("y",32768)     #VALUE!
   =REPT("cat",11111)   #VALUE!

Note that the third formula in the table returns a #VALUE! error because the length of the string that is returned by the function is 32,768 characters long.

The fourth formula in the table returns a #VALUE! error because the length of the string that is returned by the function is 33,333 (11111*3) characters long.

NOTE: The maximum number of characters that a single cell can contain in Microsoft Excel 97 is 32,767 characters.

REFERENCES

For more information about the REPT function, click the Index tab in Microsoft Excel Help, type the following text

   rept

and then double-click the selected text to go to the "REPT" topic.


Additional query words: XL97 repeats 8.0
Keywords : xlformula xlhelp
Version : WINDOWS:97
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 18, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.