Excel: Named Constants

Using Name Manager (on Formulas Tab in Excel 2007/2010) or Name, Define on Insert menu (Excel 21003), add its name e.g. vat, and in the Refers To window, type “=0.14”. Now it can be used in a formula, e.g. “=B12*vat”.

To create a User Defined Function that uses it to add VAT, try:

Named Constants Excel

Use in your workbook as follows “=VatInc(A1). The “vat” value includes the equal sign (“=0.14”). This function uses Right to strip that out, otherwise an error will result. Cdbl converts the string.

Bio: This article was written by Jasper Cook, Excel guru and trombonist of note. Call or email us if KRS can assist you with your Excel: enquiries@krs.co.dev

Let's keep in touch

We promise not to spam you; expect an email a month about what’s happening at KRS and our views on the software development industry in general.

By signing up for this newsletter I agree to krs.co.za’s Privacy Policy