Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Brenda Rueter
 
Posts: n/a
Default Calculate In-Between Numbers

User wants to combine within one formula:
If C8 < x,then C6-90
If C8 x but under xx, C6-120
If C8 xx but < xxx, C6-150
If C8 xxx, C6-180

Is there a function that will do the in-between parts for me?


  #2   Report Post  
LanceB
 
Posts: n/a
Default

=IF(C8<A1,C6-90,IF(C8<A2,C6-120,IF(C8<A3,C6-150,C6-180)))

a1 = x
a2 = xx
a3 = xxx

"Brenda Rueter" wrote:

User wants to combine within one formula:
If C8 < x,then C6-90
If C8 x but under xx, C6-120
If C8 xx but < xxx, C6-150
If C8 xxx, C6-180

Is there a function that will do the in-between parts for me?



  #3   Report Post  
Brenda Rueter
 
Posts: n/a
Default

This does not take into account x but < than xx.
Let's say
a1=100
a2=200
a3=300

we want smaller than 300 but larger than 200. That's the part we're having
trouble putting together. The straight nesting IF statement is no problem.

"LanceB" wrote in message
...
=IF(C8<A1,C6-90,IF(C8<A2,C6-120,IF(C8<A3,C6-150,C6-180)))

a1 = x
a2 = xx
a3 = xxx

"Brenda Rueter" wrote:

User wants to combine within one formula:
If C8 < x,then C6-90
If C8 x but under xx, C6-120
If C8 xx but < xxx, C6-150
If C8 xxx, C6-180

Is there a function that will do the in-between parts for me?





  #4   Report Post  
Leo Heuser
 
Posts: n/a
Default

Brenda

One way:

=C6-(C8<x)*90-(AND(C8=x,C8<xx))*120-(AND(C8=xx,C8<xxx))*150-(C8=xxx)*180

assuming =x, =xx and =xxx

--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"Brenda Rueter" skrev i en meddelelse
...
User wants to combine within one formula:
If C8 < x,then C6-90
If C8 x but under xx, C6-120
If C8 xx but < xxx, C6-150
If C8 xxx, C6-180

Is there a function that will do the in-between parts for me?




  #5   Report Post  
arno
 
Posts: n/a
Default

Hi Brenda,

User wants to combine within one formula:
If C8 < x,then C6-90
If C8 x but under xx, C6-120
If C8 xx but < xxx, C6-150
If C8 xxx, C6-180

Is there a function that will do the in-between parts for me?


lookup() will do the job for you, have a look in excel help. however,
make sure you get correct results if eg. c8=xx (exactly xx, not
smaller, not bigger).

you need a table "data" like this one
0 90
x 120
xx 150
xxx 180


then you can use
=c6-lookup(c8,data,2,TRUE)


arno



  #6   Report Post  
Markus L
 
Posts: n/a
Default

"Brenda Rueter" wrote in message
...
User wants to combine within one formula:
If C8 < x,then C6-90
If C8 x but under xx, C6-120
If C8 xx but < xxx, C6-150
If C8 xxx, C6-180


Brenda, try this one:
=IF(C8xxx,C6-180,IF(C8xx,C6-150,IF(C8x,C6-120,C6-90)))
Not elegant at all, a simple translation of your requirements.


  #7   Report Post  
arno
 
Posts: n/a
Default

ooops:

it should be VLOOKUP!

arno

lookup() will do ...
then you can use
=c6-lookup(c8,data,2,TRUE)


  #8   Report Post  
Brenda Rueter
 
Posts: n/a
Default

Thanks everyone. I'm working with the different solutions offered here.

"Markus L" wrote in message
...
"Brenda Rueter" wrote in message
...
User wants to combine within one formula:
If C8 < x,then C6-90
If C8 x but under xx, C6-120
If C8 xx but < xxx, C6-150
If C8 xxx, C6-180


Brenda, try this one:
=IF(C8xxx,C6-180,IF(C8xx,C6-150,IF(C8x,C6-120,C6-90)))
Not elegant at all, a simple translation of your requirements.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I automatically calculate YTD numbers by changing a date? MDSistah Excel Worksheet Functions 1 April 29th 05 05:52 PM
Match Last Occurrence of two numbers and Return Date Sam via OfficeKB.com Excel Worksheet Functions 6 April 5th 05 12:40 PM
Match Last Occurrence of two numbers and Count to Previous Occurence Sam via OfficeKB.com Excel Worksheet Functions 33 April 4th 05 02:17 PM
Converting Numbers to Text properly Shirley Munro Excel Discussion (Misc queries) 1 February 16th 05 03:01 PM
Formula to calculate only the negative numbers Dawn Boot-Bunston Excel Worksheet Functions 5 November 24th 04 09:57 PM


All times are GMT +1. The time now is 03:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"