More than one range in an IF(AND function

apar93

New Member
Joined
Nov 8, 2017
Messages
33
Is it possible to put more than one range in an IF(AND( function. For example: IF(AND(A27>=1,A27<=3),A27*5),IF(AND(A27>=4,a27<=6)A27*6)
Is there a way I can do this? Because excel doesn't allow me to.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
You have a misplaced ), and you're missing a comma.
IF(AND(A27>=1,A27<=3),A27*5),IF(AND(A27>=4,a27<=6)A27*6)
That red ) is basically ENDING the first IF, instead of continuing it (Nesting the next if)
It should be
IF(AND(A27>=1,A27<=3),A27*5,IF(AND(A27>=4,a27<=6),A27*6))
 
Upvote 0
Sure you just have it a bit wrong:

=IF(AND(A27>=1,A27<=3),A27*5,IF(AND(A27>=4,A27<=6),A27*6,"Whatever the false should be"))

A nested if works by putting a new if statement into the false part of the previous if.
 
Upvote 0
That said, here's a couple alternate methods to try.

You don't need the AND functions there, as long as you put the if's in the right order.
=IF(A27>=7,"not specified",If(A27>=4,A27*6,IF(A27>=1,A27*5)))
or a little simpler
=IF(A27>=7,"not specified",A27*If(A27>=4,6,IF(A27>=1,5)))
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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