Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default how can I pick up a nearest value to zero

In a range of cells, I have negative and positive numbers. How can I obtain,
in another cell, the value from my range that is negative AND nearest to
zero, and, in another cell, the positive number AND nearest to zero ? Example
: in my range of cells, I have : -10 , -7 , -3 , 1 , 4 , 7 , 9. I need to
extract from this range values -3 and 1. The values in my range are changing
everytime, because they are provided by formulas.
Thank you !
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default how can I pick up a nearest value to zero

This might suffice ..
Assuming data as posted is in A1:A7, in ascending order (as posted)
in say, B1 and in C1
=INDEX(A1:A7,MATCH(0,A1:A7))
=INDEX(A1:A7,MATCH(0,A1:A7)+1)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"aiurelbn" wrote:
In a range of cells, I have negative and positive numbers. How can I obtain,
in another cell, the value from my range that is negative AND nearest to
zero, and, in another cell, the positive number AND nearest to zero ? Example
: in my range of cells, I have : -10 , -7 , -3 , 1 , 4 , 7 , 9. I need to
extract from this range values -3 and 1. The values in my range are changing
everytime, because they are provided by formulas.
Thank you !

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default how can I pick up a nearest value to zero

=MAX(IF(A1:A7<0,A1:A7))
=MIN(IF(A1:A70,A1:A7))

ctrl+shift+enter, not just enter


"aiurelbn" wrote:

In a range of cells, I have negative and positive numbers. How can I obtain,
in another cell, the value from my range that is negative AND nearest to
zero, and, in another cell, the positive number AND nearest to zero ? Example
: in my range of cells, I have : -10 , -7 , -3 , 1 , 4 , 7 , 9. I need to
extract from this range values -3 and 1. The values in my range are changing
everytime, because they are provided by formulas.
Thank you !

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default how can I pick up a nearest value to zero

Thank you, teethless mama. It works just fine ...


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default how can I pick up a nearest value to zero

The simpler, non-array index/match option would have worked fine too, if the
data is sorted in ascending order, as you had originally posted, and as
pointed out in the response. Do not dismiss the option as not helpful.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


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 you round up to nearest 10??? davemate Excel Discussion (Misc queries) 2 June 16th 06 03:23 AM
Round up to nearest 10 Cowtoon Excel Worksheet Functions 5 March 2nd 06 05:41 PM
Making pick list conditional on selection from previous pick list Stewart Excel Discussion (Misc queries) 1 June 27th 05 11:30 AM
looking up nearest value geooil Excel Worksheet Functions 0 November 17th 04 10:34 PM
looking up nearest value geooil Excel Worksheet Functions 4 November 16th 04 11:40 AM


All times are GMT +1. The time now is 04:31 AM.

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"