简体   繁体   中英

Excel - How to assign a cell value to a variable?

I don't know how to describe it its a bit complicated.

But when I pull cells down I don't want a cell to change like E2 E3 E4 . I want to make fixed E2 there. I don't want it to change when I pull down cells.

So do I have to assign it to a variable if yes, how to do it ? :)

Thats my formula;

=0+(if(d4="x";d2;0))+(if(e4="x";e2;0))+(if(f4="x";f2;0))

I want to make fixed D2 E2 F2 when I pull cells down but it changes whatever like D3 E3 F3 .

Thanks.

=IF(D4="x",$D$2,0)+(IF(E4="x",$E$2,0))+(IF(F4="x",$F$2,0))

and if your locale are german or some other ones then

=IF(D4="x";$D$2;0)+(IF(E4="x";$E$2;0))+(IF(F4="x";$F$2;0))

and refer to this answer for more details about the $ dollar sign within formulas.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM