Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Displaying -1,0 or 1 depending on cell value?


Hi all,

Im trying to get a cell to display either 1, 0 or -1 depending on other
cells product here's what i'm using
=IF(E5=0,0,IF(OR(B$5-E5<0,B$5-E54),0,VLOOKUP(B$5-E5,{-1,1;-2,1;-3,1;1,-1;2,-1;3,-1},2)))
i can get itto display 0 or -1 or 0 and 1, my criteria is this if E5
B5 by any amount then display -1 if E5 = B5 then display 0 and if E5<B5
by any amount display 1.

I cant seem to manage it with the formula above, any ideas?

Regards,
Simon


--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=546345

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Displaying -1,0 or 1 depending on cell value?

=sign(B5-E5)

--
Regards,
Tom Ogilvy

"Simon Lloyd"
wrote in message
...

Hi all,

Im trying to get a cell to display either 1, 0 or -1 depending on other
cells product here's what i'm using

=IF(E5=0,0,IF(OR(B$5-E5<0,B$5-E54),0,VLOOKUP(B$5-E5,{-1,1;-2,1;-3,1;1,-1;2,
-1;3,-1},2)))
i can get itto display 0 or -1 or 0 and 1, my criteria is this if E5
B5 by any amount then display -1 if E5 = B5 then display 0 and if E5<B5
by any amount display 1.

I cant seem to manage it with the formula above, any ideas?

Regards,
Simon


--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile:

http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=546345



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Displaying -1,0 or 1 depending on cell value?

One way:

=SIGN(B5-E5)

In article ,
Simon Lloyd
wrote:

my criteria is this if E5 B5 by any amount then display -1 if E5 =
B5 then display 0 and if E5<B5 by any amount display 1.

I cant seem to manage it with the formula above, any ideas?

Regards,
Simon

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Displaying -1,0 or 1 depending on cell value?


JE & Tom, Thanks!!!! i can't believe it was that simple, i was looking
at a very long winded complicated way.....you know...sledge hammer to
crack a nut!

Cheers!
Simon


--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=546345

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
Displaying a number with different decimals depending on a condition JGarces Excel Worksheet Functions 1 August 16th 06 05:37 PM
How can i change cell colour depending on month of date in cell? andy75 Excel Discussion (Misc queries) 2 January 6th 06 07:46 AM
How do I change the color of a cell depending on the result of the function in that cell Mo Childs[_2_] Excel Programming 4 November 1st 05 09:30 PM
Automated cell copy depending on cell content? Joachim Fabini Excel Programming 5 November 20th 03 07:54 AM
displaying varying toolbars depending on workbook Rich[_13_] Excel Programming 0 July 30th 03 11:26 PM


All times are GMT +1. The time now is 02:18 PM.

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

About Us

"It's about Microsoft Excel"