=IF(and problems

dlatha01

Board Regular
Joined
Apr 7, 2009
Messages
65
Hi Guys,

The below formula doesnt work. Any help much appreciated.

Thanks

=IF(OR($G2>3000000,$G2<5000000), "3-5Mn", "-",IF(AND($G2<3000000), "<3Mn", "-",IF(AND($G2>10000000), ">10Mn", "-")))
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Couple things.

1. OR($G2>3000000,$G2<5000000)
This is ALWAYS true for any number in G2
Perhaps you mean that to be
AND($G2>3000000,$G2<5000000)

2. You haven't defined all the ranges, what result is expected for a number between 5000000 and 10000000 ?


Lookup is probably the best way to go here..

Something like
=LOOKUP($G2,{0,3000000,5000000,10000000},{"<3","3-5","5-10",">10"})
 
Upvote 0
Try this:

=IF(AND($G2>3000000,$G2<5000000), "3-5Mn", IF($G2<3000000, "<3Mn", IF($G2>10000000, ">10Mn", "-")))
 
Upvote 0

Forum statistics

Threads
1,206,808
Messages
6,074,985
Members
446,111
Latest member
trduy1908

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