Adding an Extra condition to an IF statement

Grimlocc

New Member
Joined
Aug 4, 2017
Messages
20
Hello,

I am trying to add an extra condition into my formula but I can’t make it work.

So far, what I have is this:

=IF(C28=B11,1, IF(C28=B11-1,1, IF(C28=B11-2,1, IF(C28=B11-3,1, IF(C28=B11-4,1, IF(C28=B11-5,1,0))))))

Which is basically saying, if C28 is equal to or less than B11 by up to -5, return the number ‘1’. This is fine and works how I want.

What I am trying to do is add something extra in that means the value returned will be a zero rather than a 1 if the value in cell B11 is a zero.

I had done this:

=IF(AND(B11<>0)&C28=B11,1, IF(C28=B11-1,1, IF(C28=B11-2,1, IF(C28=B11-3,1, IF(C28=B11-4,1, IF(C28=B11-5,1,0))))))

Which did work to an extent but failed when a higher number than zero was in B11 and another number in a different cell but linked to B11 matched that higher number.

Does anyone have any idea how I might go about doing this?

Thanks very much
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Perhaps =IF(or(B11=0,C28<<b11,c28>b11-5,C28>b11),0,1)</b11,c28>
 
Last edited:
Upvote 0
Brilliant! Both of these appear to work perfectly - I'll put them through a bit more testing but so far, so good. Thanks very much :)
 
Upvote 0
Formula won't paste - sending a message to admin<b11)<b11)<b11)< html=""></b11)<b11)<b11)<>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top