You are here:

# Excel/one cell has 2 formullas

Question
Dear Tom;
Hope you are doing well, I am facing two main challenges in my Excel sheet.
The first is;
I have a (total) cell which includes the sum of both (X, lets say E1:E10) and (Y, lets say A1:X1) culomn.

For some reason, it seems difficult to use (AND) and I couldnt gather these two equations for one cell (Total)

The second is;
How can I fix a cell with a fixed number while the parrelle cells (to this fixed one) remain changeble
for example; cell A1 is the total cell (which stand for number of ICU beds, lets say 200 beds)
Cell B1 is number of occupied bed (change value) and C1 is the number of vacant ICU bed (changed vlue).

I need to be sure that numbers in A1 is accurate, so if I change B1 to 80, C1 should be changed into 120 to keep the total 200

Epidemiologist Nahid Batarfi

Nahid Batarfi,

AND is a logical function.  It would be used if your were testing conditions

example   =if(And(A1>=10,A1=<20,"A1 between 10 and 20 inclusive","A1 either <10 or >20")

if you want to get the total for two ranges you would use sum

=sum(A1:X1,E1:E10)

that, will add E1 twice. so you could subtract it once or insure it is only added onece

=sum(A1:X1,E1:E10)-E1

or

=sum(A1:X1,E2:E10)

for your second issue, if you type a number in A1 it should remain that number.  Calculation should not change the number.  If you want to prevent anyone from editing cell A1 and changing the value of the number, then that is a different issue.

Each cell has a locked property.  by default, all cells in a new workbook are locked.  However, this does nothing until you protect the worksheet.  If you protect the worksheet, then locked cells can not be edited.  So if you want to pursue protecting your worksheet, you need to unlock the cells where you want to allow users to edit the cell.  You change this property by selecting the cell or cells and right clicking.  Choose format cells.  There should be a tab in the dialog called protection.  Click on that Tab and you can uncheck the locked property.
Then save your file when done.  Now you can go to the review tab and select protect worksheet and assign a password.   There are also options you can specify to related to what can be done on a protected worksheet.  The help is a good place to go to find out about this or do a google or bing search on the microsoft office site to find articles about protection and all the options available to you - the topic is much more involved than could be discussed here - but for basic protection, I have told you how to do that.

--
Regards,
Tom Ogilvy

This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

#### Tom Ogilvy

##### Expertise

Selected as an Excel MVP by Microsoft since 1999. Answering Excel questions in Allexperts since its inception in 2001. Able to answer questions on almost all aspects of Excel's internal capabilities. If seeking a VBA solution, please specify that in your question itself so I give you the answer you want. [Excel has weak protection - if you are distributing an application, I don't answer questions on how to protect your project from your users.]

##### Experience

Extensive experience.

Education/Credentials
Master of Science (MS) degree Operations Research (ORSA)

Awards and Honors
Microsoft MVP in Excel.