#VALUE! with if great than or less than x then do this formula

TeressaJP

New Member
Joined
Oct 10, 2011
Messages
13
my formula below is returning #VALUE

What I need is: If C2 is "New" and G2 is less than 7 but greater than 3 then return .0.1; If G2 is less than 5 but greater than 3 then return .0125; If G2 is less than 3 but greater than 0 then return .015; if G2 equals zero then return zero.

If C2 is "Renewal" follows same as above but with different returns. What am I doing wrong?


'=IF(C2="New",IF(G2<7>3,0.01,IF(G2<5>3,0.0125,IF(G2<3>0,0.015,IF(G2=0,0.02,0))))),IF(C2="Renewal",IF(G2<4>3,0.01,IF(G2<3>0,0.015,IF(G2=0,0.02,0))),0)
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
This format is not used by Excel:

G2<7>3

The equivalent is AND(G2>3,G2<7)

But a LOOKUP formula is simpler:

=IF(C2="NEW",LOOKUP(G2,{0,3,5,7},{0,0.15,0.125,0.1}),0)
 
Upvote 0
"But a LOOKUP formula is simpler: =IF(C2="NEW",LOOKUP(G2,{0,3,5,7},{0,0.15,0.125,0.1}),0)" When I use this formula, my return is zero if G2 is 2 or 4 which is why I need the less than/greater than included. Right?:confused:

"This format is not used by Excel: G2<7>3
The equivalent is AND(G2>3,G2<7)"

Changing the format of the greater than less than to match what is supported, see below, I still return the #VALUE!. :(


'=IF(C2="New",AND(G2<7,G2>3,0.01,AND(G2<5,G2>3,0.0125,AND(G2<3,G2>0,0.015,AND(G2=0,0.02,0))))),IF(C2="Renewal",AND(G2<4,G2>3,0.01,AND(G2<3,G2>0,0.015,AND(G2=0,0.02,0))),0)
 
Upvote 0
Your return on my formula would only return 0 if C2 didn't equal NEW. It would however return 0 on 2 because it is not greater than or equal to 3. 4 would work however.
 
Upvote 0
Let's start again.

Are these the desired results ?

C2.......G2....Result
New.....8......0
New.......6......0.01
New.......4......0.0125
New.......3......?????? please advise
New.......2......0.015
New.......0......0.02
Renewal..5......0
Renewal..3.5...0.01
Renewal..3......?????? please advise
Renewal..2......0.015
Renewal..0......0.02
 
Upvote 0
Let's start again.

These are the desired results:


C2.......G2....Result
New.....8......0
New.......6......0.01
New.......4......0.0125
New.......3.......0.0125
New.......2......0.015
New.......0......0.02
Renewal..5......0
Renewal..3.5...0.01
Renewal..3......0.01
Renewal..2......0.015
Renewal..0......0.02


(This format is very helpful):biggrin:
 
Upvote 0
Some guessing, change the red bits to what you're wanting:
Code:
=IF(C2="New",INDEX({0.01;0.0125;0.015;0.2},MATCH(G2,{7;5;3;0},-1)),IF(C2="Renewal",INDEX({[COLOR=Red]1;1.25;1.5;2[/COLOR]},MATCH(G2,{7;5;3;0},-1)),[COLOR=Red]"Not 'New' Or 'Renewal'"[/COLOR]))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,352
Messages
6,124,457
Members
449,161
Latest member
NHOJ

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