Can I include both AND and OR in the same function?

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I'm performing calculations on market data during specific times.
(1000AM to 1130AM and 1330PM to 1500PM)
Can I include both AND and OR in my function, or can it be accomplished with
only one of these items?
If so, could you provide the syntax?
Thanks in advance.
 
Yes you can use them in the same formula but those are not times they are
text strings so you need to break them up in time values if you need any
sort of calculation done. Maybe you can explain in detail what you want to
do, how you expect a result to look etc?

--


Regards,


Peo Sjoblom
 
Peo, I download a series of prices based on a certain number of price ticks.
As each series of ticks is completed it also includes the time of completion
in 24hour format. So I have columns with Time, Open, High, Low, Close,
followed by a series of columns of technical indicators for daily periods of
24 hours. I only want to perform additional work the data from the periods
mentioned above so I was using AND and realized using if(and(a1>959, a1<1131,
a1>1259, a1<1501),if(the rest of my calculations in this section,"")"").
This version caused the additional calculations to be performed on all rows
of data rather than only the two periods during the day I was looking for. I
was hoping to be able to insert the OR statement after the logical test
a1<1131 but could not master it. My lack of experience is probably showing
but I would appreciate any help you could provide. Thanks! Dave
 
It would look like this incorporating OR


=IF(OR(AND(A1>959,A1<1131),AND(A1>1259,A1<1501)),"Do This","Do That")

--


Regards,


Peo Sjoblom
 
I'm performing calculations on market data during specific times.
(1000AM to 1130AM and 1330PM to 1500PM)
Can I include both AND and OR in my function, or can it be accomplished with
only one of these items?
If so, could you provide the syntax?
Thanks in advance.

Yes, you can.

OR(AND(A1>1000,A1<1130),AND(A1>1330,A1<1500))

Note that I'm just giving you the syntax. I'm assuming you have those
times in other cells, you should use references to them. Otherwise,
the actual numbers for these times are decimals, like 1:30pm is .5625
to Excel.
 
Peo Sjoblom said:
It would look like this incorporating OR


=IF(OR(AND(A1>959,A1<1131),AND(A1>1259,A1<1501)),"Do This","Do That")

-- Peo
Thank you.....it works as I need it, (in spite of my poor description to you)!
I hope someday I will be expreienced enough to pay forward the help you gave
me today. Thanks Again! Dave Columbus, Ohio
 
Spiky
When you experienced folks write the syntax and I then see it...it seems so
simple and logical.....but without your initial hand up by showing the
actual syntax to get me started it seems like confetti.
Thanks you!
Dave
 
My pleasure Dave, thanks for the feedback. It feels good helping nice polite
people like yourself.

--


Regards,


Peo Sjoblom
 
Back
Top