IF Statement when multiple conditions are met

paularthur

New Member
Joined
Mar 12, 2015
Messages
12
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
Joined
Oct 27, 2005
Messages
20,872
Office Version
  1. 2016
  2. 2013
  3. 2007
Platform
  1. Windows
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:
Solution

paularthur

New Member
Joined
Mar 12, 2015
Messages
12
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
Joined
Oct 27, 2005
Messages
20,872
Office Version
  1. 2016
  2. 2013
  3. 2007
Platform
  1. Windows
See my edit to Post #2
 

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
20,872
Office Version
  1. 2016
  2. 2013
  3. 2007
Platform
  1. Windows
Glad to help... :cool: (y)
 

Forum statistics

Threads
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.
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
Top