Comparing voltages

Is there a command or a way to check for a range of voltages or does it have to be one specific voltage? Example.... Can I have analogRead look for .5 to 1.5V or can it only look for one or the other? If it's possible, what would the syntax look like? Thanks to all!

analogRead() returns a value from 0 to 1023 that corresponds to the ratio between the voltage of the pin and the reference voltage. You can use an if statement to check if the value is within some range.

int val = analogRead(0);
if(val >= 400 && val <= 700)

Perfect! Thank you very much!