how do I do a formula in excel such as if A1=something then b1= a set value ?
how do I do a formula in excel such as if A1=something then b1= a set value ?
type this in B1
=if(A1="somestring",thesetvalue,"")
this means if A1 =somestring then the cell where you put the formula
is=setvalue, otherwise the cell is blank
Brett <[email protected]> wrote in message
news:[email protected]...
> how do I do a formula in excel such as if A1=something then b1= a set
value ?
Brett,
If you are dealing with just numbers, you can use Boolean logic too. This
formula says "if A1=1 then 5 else if A1=2 then 6".
=((A1=1)*5) + ((A1=2)*6)
If you want all of the conditions to be true in order to return a value,
substitute the plus sign for a multiplication sign.
Boolean logic is also a way to get around the nested IF limitations.
----
Regards,
John Mansfield
http://www.pdbook.com
"Brett" wrote:
> how do I do a formula in excel such as if A1=something then b1= a set value ?
I would think the easiest way would be to use the "IF" function and an
absolute value. Pick a cell to be your "absolute" or as you put it "set"
value. Just for kicks say that cell is A50. Your set /absolute value in
that cell is 100. Your IF function goes into cell B1.
Let's assume you want to say this:
If the value in A1 is greater than or equal to the absolute value in cell
A50, then the value in cell B1 is 25. If not, the value is 0. Here's the
easiest way to do that:
1. Enter the number 100 in Cell A50
2. Enter the number 150 in Cell A1
2. Click on cell B1
3. enter the = sign
4. Use the arrow in your function box and select the IF function. This
will open the IF function dialog box
5. Click in the Logical Test Box and then click on cell A1. After Excel
enters A1 you add >=$A$50. In effect, at this point you have told Excel to
see if the value in cell A1(150) is greater than or equal to the set value in
cell A50(100). The $ have to be entered to make that value "set." Since it
is greater than that value, the word "True" should appear at the end of the
first dialog bax. If it does, you have a correct test and can go on to step
6. If it doesn't, you have done something wrong.
6. Go to the "If True" box and type in 25.
7. Go to the "If False" box and type in 0.
You're done! If you have done it right, the value in cell B1 should be 25.
Now go back to cell A1 and change it to 95. Since this is less than 100,
your value in B1 should now be 0. Hope this wasn't too confusing!
Logical test:
"Brett" wrote:
> how do I do a formula in excel such as if A1=something then b1= a set value ?
Order would like to put... If he is in column A number is likewise 1.5 right, when first are three numbers within column A equal 1,5 are right, other number can't to be any more right.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks