Help with creating an array

Hi guys, i was wondering if anyone could help me with turning this if statement into an Array?

if(val < 254){
digitalWrite(LED1, HIGH);}
if(val > 254){
digitalWrite(LED1, LOW);
Serial.println(val);
}

if(val>250 && val < 509){
digitalWrite(LED2, HIGH);
digitalWrite(LED2, LOW);
Serial.println(val);
}

if(val > 510 && val< 764){
digitalWrite(LED3, HIGH);
digitalWrite(LED3, LOW);
Serial.println(val);
}

if(val > 765 && val < 1023){
digitalWrite(LED4, HIGH);
digitalWrite(LED4, LOW);
Serial.println(val);

I think you missed some lines of code there, for example some lines that say "else".

You also forgot to use code tags. Please edit your post above and put them in so your code looks like

this

And how do you mean "turn it in a array"? An array is for holding stuff, an if is to make a decision....

So post all the code and explain more clearly what you want. A XY-problem now.

int limits[] ={0, 250, 500, 1023};
if(val>=limits[0] && val< limits[1])
{
}
else if(val>=limits[1] && val< limits[2])
{
}
else if .......
{
...
...

Just to give you the idea.

If there are gaps in the boundaries, you neef an array with min values and one with max values (or even better, make use of an array of structs.)