excel2013中通过定义名称来定义变量的步骤:
首先,建立如下图的表格,这个比较简单。“在下面输入订购数量”这个属于提示语,意思是在它下面的表格中输入订购数量的数字即可。A、B、C、D四个厂家的单价分别为10元、20元、30元和40元。

然后,选中图(2-1)所示的表格---点击【公式】(2-2)---点击【定义名称】(2-3)---出现(2-4)的新建名称对话框---在名称里面输入“订购数量”(2-5)----在(2-6)中可以看到引用位置为C列4行---点击确定(2-7)。在(2-8)中可以看到,选中的表格就代表“订购数量”。


在c行4列中输入10,表示将10赋给“订购数量”这一个文字变量,意思就表示订购数量就是10个(图元3-1)。选中e列8行,然后输入 =d8*订购数量 (图3-2),当然点击鼠标也可以。按键盘回车键后发现数值变成了100,说明总价钱为100元(图3-3)。将鼠标放到e列8行右下角出现黑色的“+”,然后按住鼠标左键不放,拉到e列11行,价钱都算了出来(图3-4)。




将订购数量改为100(4-1),相应的总价格也发生了变化(4-2)。

在g列4行中输入 =订购数量 (5-1) , 回车后 发现数值变成了100(5-2)。至此我们就明白了 订购数量 已经成为了一个变量 而非简单的一个名字 可以理解为是文字变量,与字母变量是一个概念。


点击(6-1)的【名称管理器】---出现名称管理器对话框---可以看到(6-2)我们定义的变量(订购数量)---同样可进行 新建,编辑和删除操作(6-3),大家可以动手试一下。
