How do I assign a number value to a letter.
I'm making a class attendence spread sheet.
I want to assign 10 points for "P" Present
7 points for "T" Tardy etc.
How do I prevent it from interfering with all the assigned P/Ts etc.
Thanks
How do I assign a number value to a letter.
I'm making a class attendence spread sheet.
I want to assign 10 points for "P" Present
7 points for "T" Tardy etc.
How do I prevent it from interfering with all the assigned P/Ts etc.
Thanks
There are a number of ways to go about this.
Here is one way.
Say cell B2 contains the letter "P" or "T".
Cell C2 could contain this formula:
=if(B2="P",10,if(B2="T",7,0))
Thank you. I entered the formula in Cell B2 but when I type the Letter "P" in the cell it overtypes the formula.
You could use the COUNTIF function to total points as discussed.
If you have the attendance record for a pupil in cells A1:A10,
This formula
=(COUNTIF(A1:A10,"P")*10)+(COUNTIF(A1:A10,"T")*7)
Will return the total points for that pupil.
Rule 1: Never merge cells
Rule 2: See rule 1
"Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".
As I mentioned in the first post, you would place the formula in cell C2 and make entries of "P" or "T" in cell B2.I entered the formula in Cell B2 but when I type the Letter "P" in the cell it overtypes the formula.
A cell can contain ONLY a value directly entered or a value that is the result of a formula. As you have discovered, formulas are overwritten when data in directly entered into the cell (unless you apply protection to the cell/worksheet).
Bottom line: use cell B2 for data entry and cell C2 as a formula cell to determine which value to assign to the letter in B2.
See these links for Excel Training Resources.
Free EXCEL Training
Contextures
To extend my original example:
If cells containing P are worth 10, those containing T are worth 7, and those that are blank are worth 3;
=(COUNTIF(A1:A10,"P")*10)+(COUNTIF(A1:A10,"T")*7)+(COUNTIF(A1:A10,"")*3)
My original formula assigns a value of zero if the cell doesn't contain "P" or "T". If the cell is empty what value do you want to assign to it?How do I assign a cell, that will have no data enetered into it, a number value.
You could just change the last argument from zero to another number.
=IF(B2="P",10,IF(B2="T",7,3))
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks