#1   Report Post  
Posted to microsoft.public.excel.misc
Sam Sam is offline
external usenet poster
 
Posts: 699
Default Finding a number

Hi, I wonder if any one can help, I want to look for a number in a row of
cells, I have a row of twenty cells that have a number in each all different,
What I would like to do is search the row for a number between 39814 and
39844 and copy it into another cell, there will only be one number in this
range.
Can any one help, Thanks in advance, Sam.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Finding a number

One way...

A1:T1 = numbers

A3 = 39814
B3 = 39844

Is it just a coincidence that those are the serial date numbers for the
dates 1/1/2009 and 1/31/2009 ?

=SUMIF(A1:T1,"="&A3,A1:T1)-SUMIF(A1:T1,""&B3,A1:T1)

--
Biff
Microsoft Excel MVP


"Sam" wrote in message
...
Hi, I wonder if any one can help, I want to look for a number in a row of
cells, I have a row of twenty cells that have a number in each all
different,
What I would like to do is search the row for a number between 39814 and
39844 and copy it into another cell, there will only be one number in this
range.
Can any one help, Thanks in advance, Sam.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Finding a number

=SUMIF(A1:T1,"="&A3,A1:T1)-SUMIF(A1:T1,""&B3,A1:T1)

Even better!

=SUMIF(A1:T1,"="&A3)-SUMIF(A1:T1,""&B3)

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
One way...

A1:T1 = numbers

A3 = 39814
B3 = 39844

Is it just a coincidence that those are the serial date numbers for the
dates 1/1/2009 and 1/31/2009 ?

=SUMIF(A1:T1,"="&A3,A1:T1)-SUMIF(A1:T1,""&B3,A1:T1)

--
Biff
Microsoft Excel MVP


"Sam" wrote in message
...
Hi, I wonder if any one can help, I want to look for a number in a row of
cells, I have a row of twenty cells that have a number in each all
different,
What I would like to do is search the row for a number between 39814 and
39844 and copy it into another cell, there will only be one number in
this
range.
Can any one help, Thanks in advance, Sam.





  #4   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Finding a number

Here's one way, Sam

Assume your source range is A2:A20
Put this in the cell where you want the result,
say in B2, press normal ENTER to confirm:
=INDEX(A2:A20,MATCH(1,INDEX((A2:A2039814)*(A2:A20 <39844),),0))
B2 will return the required result

If you need an error trap to return neat looking blanks should there not be
a match, use IF(ISNA to trap the MATCH part of it, indicatively:
=IF(ISNA(MATCH(..)),"",INDEX(..))

viz, in B2:
=IF(ISNA(MATCH(1,INDEX((A2:A2039814)*(A2:A20<3984 4),),0)),"",INDEX(A2:A20,MATCH(1,INDEX((A2:A20398 14)*(A2:A20<39844),),0)))

Success? celebrate it, hit the YES below
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:27,000 Files:200 Subscribers:70
xdemechanik
---
"Sam" wrote:
Hi, I wonder if any one can help, I want to look for a number in a row of
cells, I have a row of twenty cells that have a number in each all different,
What I would like to do is search the row for a number between 39814 and
39844 and copy it into another cell, there will only be one number in this
range.
Can any one help, Thanks in advance, Sam.

  #5   Report Post  
Posted to microsoft.public.excel.misc
Sam Sam is offline
external usenet poster
 
Posts: 699
Default Finding a number

HI, T thanks a will give that a try and yes they are dates, my dad said it
may be easier to convert them to numbers, Sam

"T. Valko" wrote:

=SUMIF(A1:T1,"="&A3,A1:T1)-SUMIF(A1:T1,""&B3,A1:T1)


Even better!

=SUMIF(A1:T1,"="&A3)-SUMIF(A1:T1,""&B3)

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
One way...

A1:T1 = numbers

A3 = 39814
B3 = 39844

Is it just a coincidence that those are the serial date numbers for the
dates 1/1/2009 and 1/31/2009 ?

=SUMIF(A1:T1,"="&A3,A1:T1)-SUMIF(A1:T1,""&B3,A1:T1)

--
Biff
Microsoft Excel MVP


"Sam" wrote in message
...
Hi, I wonder if any one can help, I want to look for a number in a row of
cells, I have a row of twenty cells that have a number in each all
different,
What I would like to do is search the row for a number between 39814 and
39844 and copy it into another cell, there will only be one number in
this
range.
Can any one help, Thanks in advance, Sam.








  #6   Report Post  
Posted to microsoft.public.excel.misc
Sam Sam is offline
external usenet poster
 
Posts: 699
Default Finding a number

Thank you Max, I will give that a go as well, Sam

"Max" wrote:

Here's one way, Sam

Assume your source range is A2:A20
Put this in the cell where you want the result,
say in B2, press normal ENTER to confirm:
=INDEX(A2:A20,MATCH(1,INDEX((A2:A2039814)*(A2:A20 <39844),),0))
B2 will return the required result

If you need an error trap to return neat looking blanks should there not be
a match, use IF(ISNA to trap the MATCH part of it, indicatively:
=IF(ISNA(MATCH(..)),"",INDEX(..))

viz, in B2:
=IF(ISNA(MATCH(1,INDEX((A2:A2039814)*(A2:A20<3984 4),),0)),"",INDEX(A2:A20,MATCH(1,INDEX((A2:A20398 14)*(A2:A20<39844),),0)))

Success? celebrate it, hit the YES below
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:27,000 Files:200 Subscribers:70
xdemechanik
---
"Sam" wrote:
Hi, I wonder if any one can help, I want to look for a number in a row of
cells, I have a row of twenty cells that have a number in each all different,
What I would like to do is search the row for a number between 39814 and
39844 and copy it into another cell, there will only be one number in this
range.
Can any one help, Thanks in advance, Sam.

  #7   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Finding a number

Welcome
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:27,000 Files:200 Subscribers:70
xdemechanik
---
"Sam" wrote in message
...
Thank you Max, I will give that a go as well, Sam



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
Finding first number in a row Cadders Excel Worksheet Functions 2 May 30th 08 11:01 AM
Finding a row number Farhad Excel Discussion (Misc queries) 5 November 22nd 07 07:39 PM
Finding number less than 1 Sony Excel Discussion (Misc queries) 2 October 27th 06 01:19 AM
finding a number and the number of times it occurs luposlipophobia Excel Discussion (Misc queries) 3 June 22nd 06 03:51 AM
finding the right number kevindict Excel Worksheet Functions 2 September 7th 05 11:27 PM


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