What is the error here ?
How do I fix this ?
2016-03-02_0835.png
What is the error here ?
How do I fix this ?
2016-03-02_0835.png
Looks as though it might be the wrong type of double quote ... ” instead of "
Yes..you are right ...there was quote issue. ..its fixed now.
I want to add these conditions in expression..
if(B1>264 AND <283 , "BUY")
if(B1<264, "STOP")
if(B1>283, "WATCH")
What is the correct syntax to do this ? Can we add multiple conditions on a cell ?
Maybe this...
=IF(AND(B1>264,B1<283),"BUY",if(B1<264,"STOP","WATCH"))
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
Formula:
Please Login or Register to view this content.
thats a scary looking syntax...
there is a if inside a if.
"and" looks as a function
I wish if there was a simpler syntax ..
anyway...this seems working.
is it possible to see a green color text for buy ? that would be very nice looking in my spreadsheet.
It,s not really that bad. Just break it down and it's really fairly straight forward...
=IF(AND(B1>264,B1<283),"BUY",if(B1<264,"STOP","WATCH"))
It starts with the IF statement
=IF(this-is-true, Do-This, Else-Do-That)
The cool thing about that is that Do-This and Do-That can both also be IF statements, which can also contain IF statements...
=IF(its a boy,IF(he is blonde,IF(he is under 21,IF(he speaks english,IF(...............these can be "nested" many many deep, and this was all JUST for the Do-This part. The Do That part can look the same, if you wanted
when you test for 2 things, they either BOTH need to match, or ONLY one needs to match. For that we use AND or OR...
AND(B1>264,B1<283)
In this case, we are testing to see that B1 > 264 AND B1 < 283
So, if B1>264 AND B1<283, return "BUY",
if B1 is outside that range we need a 2nd test...
IF(B1<264,"STOP","WATCH")
put them all together,,,
=IF(AND(B1>264,B1<283),"BUY",if(B1<264,"STOP","WATCH"))
Make sense?
OK on to the coloring
We can do that with Conditional Formatting (probably again, something new to you?) It causes cells to change their format (color etc) based on what is shown in the cell
1. highlight the range you want to apply the conditional formatting to
2. on the home tab, styles, select CF
3. select new rule, select use formula
4. enter =A1="Buy"
Change A1 as needed
Hi,
Or this if B1 not less than zero:
=LOOKUP(B1,{0,264,284},{"stop","buy","watch"})
Blessing
I'm using online google spreadsheet. How do you do that colouring part there with this ?
B1 > 264 AND B1 < 283 = > AND(B1>264,B1<283) // this is odd looking syntax ... this looks like AND is a function !
but anyway ...this works...thanks
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks