Take the 2-minute tour ×

Is it possible to declare variables in Excel cells and use it as parameter for formula in other cells? For example I would declare var1=20 in one of the cells. In other cells I would use var1 for calculation like : =var1*20.


share|improve this question

4 Answers 4

up vote 32 down vote accepted

You can name cells. This is done by clicking the Name Box (that thing next to the formula bar which says "A1" for example) and typing a name, such as, "myvar". Now you can use that name instead of the cell reference:

= myvar*25
share|improve this answer
For reference, you can also name groups of cells. Using their values is a bit trickier, but it can be done :) –  Damovisa Apr 9 '09 at 6:38
@AKX: That was a nice trick! Thanks... @Damovisa: Thanks for the additional tip! Also is there a way of displaying the Cell name we assign in another cell. I would like to display the cell name in the adjacent cell so that the user is able to identify the cell name without clicking it. –  Manoj Apr 9 '09 at 6:50
Note:- This is particulary useful when copying formulas. Excel is very "helpful" and adjusts any cell references in the formula. Quite often you want the references to reamin fixed - refering to a nemed cell does the trick. –  James Anderson Apr 9 '09 at 7:28

I also just found out how to do this with the Excel Name Manager (Formulas > Defined Names Section > Name Manager).

You can define a variable that doesn't have to "live" within a cell and then you can use it in formulas.

Excel Name Manager

share|improve this answer

You can't declare a variable in a cell, but you can use (hidden) cells as variables. E.g., you could hide Column C, set C1 to


and use it as


Alternatively you can write VBA Macros which set and read a global variable.

Edit: AKX renders my Answer partially incorrect. I had no Idea you could name cells in Excel.

share|improve this answer

The lingo in excel is different, you don't "declare variables", you "name" cells or arrays.

A good overview of how you do that is below: http://office.microsoft.com/en-001/excel-help/define-and-use-names-in-formulas-HA010342417.aspx

share|improve this answer

Your Answer


