# If Function

#### BowlzyLSH

##### New Member
I am trying to use the formula =IF(30<I2<61,G2,0) but it doesnt seem to pick up the data in G2 if I2 is between 30 and 60. In fact it doesnt pick up any data.

Is there another formula I could use?

Thanks

Ian

### Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

#### DominicB

##### Well-known Member
Good morning BowlzyLSH

Welcome to the board!

Why? What is it you're trying to achieve? You need to provide a little bit more information about what you're trying to do.

DominicB

#### BowlzyLSH

##### New Member
Hi

Sorry the post seemed to cut half of my question off lol

I was asking why the formula =IF(30 < I2 < 60, H2, 0 ) does not work. If I2 is between 30 and 60 then it should pick up the data in H2, if not then give a zero balance

Hope this comes out ok

Ian

#### DominicB

##### Well-known Member
Hi BowlzyLSH

OK. Try this :

=IF(I2>30,IF(I2<60,H2,0),0)

HTH

DominicB

#### njimack

##### Well-known Member
Or you could use
Code:
`` =IF(AND(I2>30,I2<60),H2,0)``

#### BowlzyLSH

##### New Member
The second one works fine, ill check the first one too! super, thanks guys

Ian

Replies
1
Views
126
Replies
11
Views
288
Replies
14
Views
197
Replies
12
Views
281
Replies
4
Views
94

1,171,729
Messages
5,877,155
Members
433,235
Latest member

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back