i understand how to use the IF formulae if the subject is greater than or less than
eg =IF(B1>20,1,0) or =IF(B1<20,1,0)
But how would i write this if i wanted, for example to equal 1 if B1 is greater than 10 and less than 20?
i understand how to use the IF formulae if the subject is greater than or less than
eg =IF(B1>20,1,0) or =IF(B1<20,1,0)
But how would i write this if i wanted, for example to equal 1 if B1 is greater than 10 and less than 20?
Try
VBA Noob=IF(AND(B1>10,B1<20),1,0)
_________________________________________
![]()
![]()
Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters
Please remember to wrap code.
Forum Rules
Please add to your signature if you found this link helpful. Excel links !!!
thanks alot!!
Both the OR and the AND Functions preceed their argumentsSo for your specific example![]()
Please Login or Register to view this content.
Make sense?![]()
Please Login or Register to view this content.
ChemistB
You can also return the desired result with this formula
=(B1>10)*(B1<20)
often, i do things but dont know why with excel, i just know they work. Yes, that actually does make sense now, Regards, Jamie
So if i wrote something like =IF(OR(B1>10,B6>10),True,fALSE)Originally Posted by ChemistB
Would the cell = true if B1 is greater than 10, OR B6 greater than 10, otherwise false, or have i not quite got it?
Only reason i ask is that if this is the case, i would find the OR function quite useful
second thoughts, why am i asking! i will open up a sheet and have a go!
yes it does, gotta stop asking for help before i have even tried!!
learned 2 things here,
1/ how 'or' and 'and' work
2/ not to ask stupid questions without thinking!!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks