Return a value based on the type (new or existing) and value (from a range of values).

tricky321

New Member
Joined
Sep 5, 2017
Messages
2
RangeofValuesNewExisting
1to1010%8%
10to503%2.5%
50to100.8%.4%

<tbody>
</tbody>

TypeValuePercentage to Return (from the New/Existing columns above)
New40??? -What formula to use???
Existing40??? -What formula to use???
New60??? -What formula to use???
Existing60??? -What formula to use???

<tbody>
</tbody>

The first table above is the rules. In the second table under the column in red ("Percentage to Return"), I'm trying to figure what formula will return the appropriate % based on the "Type" being New or Existing and the Value falling into the specific ranges listed in the first table.

I've tried some embedded If statements, but have come up unsuccessful...

Any help will be much, much appreciated!
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Re: Need to return a value based on the type (new or existing) and value (from a range of values).

Hi Tricky,

I think you're on the right track with the nested if statements. Here's what I came up with:

=IF(A7="New",IF(B7<=$B$2,$C$2,IF(B7<=$B$3,$C$3,IF(B7<=$B$4,$C$4,"Value too high."))),IF(B7<=$B$2,$D$2,IF(B7<=$B$3,$D$3,IF(B7<=$B$4,$D$4,"Value too high."))))

So I copied your info starting with headers in A1 and the second table starting with headers in A6. The exception is that instead of Range -- Of -- Value, I condensed it to two columns: min and max. "A
is the mins, "B" is the maxes and the if statements only look at the maxes to see if the value is less than or equal to that max.

In other words the formula looks like:

=if(type = "New", if(value <= max1, then new1, if(value <= max2, then new2, if(value <= max3, then new3, "too high"))),if( ... and repeat, using existing in place of new.

Hope that's clear enough to understand.
 
Upvote 0
Re: Need to return a value based on the type (new or existing) and value (from a range of values).

Thank you very much for the assist. schwiggiddy! I believe I was incorrectly coding the value_if_false from original IF statement that analyzed "type = 'New'" to the next one analyzing "type = 'Existing'". Good to go now!

The full formula I ended up with is (assuming approximately the same cell positions as mentioned by 'schwiggiddy', above):
=IF(A9="New",IF(B9<=$B$2,$C$2,IF(B9<=$B$3,$C$3,IF(B9<=$B$4,$C$4,"too high."))),IF(A9="Existing",IF(B9<=$B$2,$D$2,IF(B9<=$B$3,$D$3,IF(B9<=$B$4,$D$4,"too high.")))))
 
Upvote 0
Re: Need to return a value based on the type (new or existing) and value (from a range of values).

Thank you very much for the assist. schwiggiddy! I believe I was incorrectly coding the value_if_false from original IF statement that analyzed "type = 'New'" to the next one analyzing "type = 'Existing'". Good to go now!

The full formula I ended up with is (assuming approximately the same cell positions as mentioned by 'schwiggiddy', above):
=IF(A9="New",IF(B9<=$B$2,$C$2,IF(B9<=$B$3,$C$3,IF(B9<=$B$4,$C$4,"too high."))),IF(A9="Existing",IF(B9<=$B$2,$D$2,IF(B9<=$B$3,$D$3,IF(B9<=$B$4,$D$4,"too high.")))))


No problem! Be aware you might want to add a error handler in case there's ever a time when the field doesn't say "New" or "Existing," maybe from a typo. Or maybe use Data Validation -> List and enter "New,Existing" into the source line.
 
Upvote 0

Forum statistics

Threads
1,215,335
Messages
6,124,326
Members
449,155
Latest member
ravioli44

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