# IF Statement when multiple conditions are met

#### paularthur

##### New Member
Hello,

I'm having trouble trying to get my head around an Excel function. I have an example below to give you an idea of what I want to achieve.

Excel Formula:
=IF(A1=50,"Is equal to 50",IF(A1<100,"its less than 100",IF(A1>49,"Greater than 49","blah")))

So if A1 was 50 all of the conditions are met so I want the output to be all the outcomes for example

Is equal to 50, its less than 100, Greater than 49.

If A1 was 60 it would give;

its less than 100, Greater than 49.

Would I need to do this in VBA or is there any other feature of Excel that would make this easier?

Thank you in advance for any help.

Paul

### Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

#### Michael M

##### Well-known Member
Your arguments will conflict with each other
If A1 is 50 then ALL 3 arguments will be true, and the first one will be accepted.
Maybe you need to give us REAL data as an example.
Are you saying you want both / all answers as a result ??
You probably need something like this, you can expand as required, depending on how many variables you want

Excel Formula:
=IF(AND(A1=50,A1<100),"Is equal to 50 and its less than 100",IF(AND(A1>49,A1<100,A1<>50),"its less than 100 and Greater than 49","blah"))

Last edited:

#### paularthur

##### New Member
Hi Michael,

Thanks for getting back to me.

That's the problem I am having, it might not be an IF i need to use. As you say the first condition is accepted but I want something that will evaluate all the conditions and give the outputs for the ones that match.

I'll post a real example when I get back on my work laptop.

Thanks again,
Paul

#### Michael M

##### Well-known Member
See my edit to Post #2

#### paularthur

##### New Member
Thank you so much Michael, thats exactly what i needed.

Replies
5
Views
86
Replies
12
Views
255
Replies
4
Views
268
Replies
1
Views
87
Replies
5
Views
103

1,140,924
Messages
5,703,182
Members
421,280
Latest member
Jaycee01

### 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