Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
CarolC
 
Posts: n/a
Default if statement in worksheet

I have a worksheet that I want to perform an if statement on. Cell N
contains an amount. In cell O, P, Q, & R, I have dollar values keyed (all in
row 2). What I want to do is say, if the amount in Cell N is greater then O,
and cell N is greater than P, etc. until it tests each of the assigned cells.
I want to have the result go into cell S!

Example: Cell N = $17,000.00. Cell O = $2000, Cell P = 5,000, with the
final Cell R= $8000. Since 17000 8000, the result (difference) should be
$2927.48 in Cell S!
I'm sure I'm making this tougher than it really is!! Thanks, in advance,
for your assistance.

  #2   Report Post  
Duke Carey
 
Posts: n/a
Default

Looking at your example I'm having a really hard time seeing how the
'difference' is $2927.48.

"CarolC" wrote:

I have a worksheet that I want to perform an if statement on. Cell N
contains an amount. In cell O, P, Q, & R, I have dollar values keyed (all in
row 2). What I want to do is say, if the amount in Cell N is greater then O,
and cell N is greater than P, etc. until it tests each of the assigned cells.
I want to have the result go into cell S!

Example: Cell N = $17,000.00. Cell O = $2000, Cell P = 5,000, with the
final Cell R= $8000. Since 17000 8000, the result (difference) should be
$2927.48 in Cell S!
I'm sure I'm making this tougher than it really is!! Thanks, in advance,
for your assistance.

  #3   Report Post  
CarolC
 
Posts: n/a
Default

So Sorry... Of course, the answer is $9,000!! Was looking at the actual
spreadsheet when I wrote this! I apologize!!

"CarolC" wrote:

I have a worksheet that I want to perform an if statement on. Cell N
contains an amount. In cell O, P, Q, & R, I have dollar values keyed (all in
row 2). What I want to do is say, if the amount in Cell N is greater then O,
and cell N is greater than P, etc. until it tests each of the assigned cells.
I want to have the result go into cell S!

Example: Cell N = $17,000.00. Cell O = $2000, Cell P = 5,000, with the
final Cell R= $8000. Since 17000 8000, the result (difference) should be
$2927.48 in Cell S!
I'm sure I'm making this tougher than it really is!! Thanks, in advance,
for your assistance.

  #4   Report Post  
Duke Carey
 
Posts: n/a
Default

Carol -

So..if N2 is than ANY of the other values, you want the difference between
N2 & the highest other value, right? That's a start. What if N2 = one of
the other values, or if it is less than any of the values?

If you simply want the difference between N2 and the highest value in O
through R, then

=N2-MAX(O2:R2)


"CarolC" wrote:

So Sorry... Of course, the answer is $9,000!! Was looking at the actual
spreadsheet when I wrote this! I apologize!!

"CarolC" wrote:

I have a worksheet that I want to perform an if statement on. Cell N
contains an amount. In cell O, P, Q, & R, I have dollar values keyed (all in
row 2). What I want to do is say, if the amount in Cell N is greater then O,
and cell N is greater than P, etc. until it tests each of the assigned cells.
I want to have the result go into cell S!

Example: Cell N = $17,000.00. Cell O = $2000, Cell P = 5,000, with the
final Cell R= $8000. Since 17000 8000, the result (difference) should be
$2927.48 in Cell S!
I'm sure I'm making this tougher than it really is!! Thanks, in advance,
for your assistance.

  #5   Report Post  
Duke Carey
 
Posts: n/a
Default

Carol -
If you want the difference between N2 and the largest value that is SMALLER
than N2, use

=IF(ISNA(LOOKUP(N2,O2:R2)),0,LOOKUP(N2,O2:R2))

which will give you a zero when N2 is smaller than any of the other values



"CarolC" wrote:

So Sorry... Of course, the answer is $9,000!! Was looking at the actual
spreadsheet when I wrote this! I apologize!!

"CarolC" wrote:

I have a worksheet that I want to perform an if statement on. Cell N
contains an amount. In cell O, P, Q, & R, I have dollar values keyed (all in
row 2). What I want to do is say, if the amount in Cell N is greater then O,
and cell N is greater than P, etc. until it tests each of the assigned cells.
I want to have the result go into cell S!

Example: Cell N = $17,000.00. Cell O = $2000, Cell P = 5,000, with the
final Cell R= $8000. Since 17000 8000, the result (difference) should be
$2927.48 in Cell S!
I'm sure I'm making this tougher than it really is!! Thanks, in advance,
for your assistance.



  #6   Report Post  
N Harkawat
 
Posts: n/a
Default

=N2-LARGE(IF(N2:R2<N2,N2:R2),1)
array entered (ctrl+shift+enter)
irrespective whether the values between O2:R2 are sorted since LOOKUP
expects them to be sorted.


"Duke Carey" wrote in message
...
Carol -
If you want the difference between N2 and the largest value that is
SMALLER
than N2, use

=IF(ISNA(LOOKUP(N2,O2:R2)),0,LOOKUP(N2,O2:R2))

which will give you a zero when N2 is smaller than any of the other values



"CarolC" wrote:

So Sorry... Of course, the answer is $9,000!! Was looking at the actual
spreadsheet when I wrote this! I apologize!!

"CarolC" wrote:

I have a worksheet that I want to perform an if statement on. Cell N
contains an amount. In cell O, P, Q, & R, I have dollar values keyed
(all in
row 2). What I want to do is say, if the amount in Cell N is greater
then O,
and cell N is greater than P, etc. until it tests each of the assigned
cells.
I want to have the result go into cell S!

Example: Cell N = $17,000.00. Cell O = $2000, Cell P = 5,000, with
the
final Cell R= $8000. Since 17000 8000, the result (difference)
should be
$2927.48 in Cell S!
I'm sure I'm making this tougher than it really is!! Thanks, in
advance,
for your assistance.



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
Do I need a sumif or sum of a vlookup formula? PeterB Excel Worksheet Functions 0 June 1st 05 12:23 PM
Search/Match between 2 x separate Worksheets and populate result in third worksheet Alan Bartley Excel Discussion (Misc queries) 1 April 11th 05 05:21 AM
Copy from worksheet to another x times Union70 Excel Discussion (Misc queries) 0 March 7th 05 09:03 PM
Weekly Transaction Processing Ralph Howarth Excel Worksheet Functions 4 January 19th 05 05:37 AM
Indirect reference from one worksheet to another Bill Sturdevant Excel Worksheet Functions 2 December 17th 04 01:23 PM


All times are GMT +1. The time now is 12:33 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"