Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
StevenL
 
Posts: n/a
Default MIN within range based on criteria

I have two rows of dates, row A - "Start" date & row B - "Due" date. In cell
A1 user can select a start date from the range in row A below. There will be
multiple lines that have same "Start" date but the "Due" date could vary. I
would like the MIN "Due" date value to appear in B1 based on the
cooresponding "Start" date user chooses in cell A1.
ie.
A1. user chooses start date / B1. MIN value row B appears
A2. 12/1/5 B2. 12/4/5
A3. 12/2/5 B3. 12/6/5
A4. 12/3/5 B4. 12/6/5
A5. 12/3/5 B5. 12/5/5
if user chooses start date of 12/3/5 the MIN value within row B range is
12/5/5. Can someone help me write a formula for B1.
Thanks, Steven

  #2   Report Post  
Max
 
Posts: n/a
Default

One way .

Put in the formula bar for B1 and array-enter
(i.e. press CTRL+SHIFT+ENTER):
=IF(A1="","",MIN(IF(A2:A100=A1,B2:B100)))

--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"StevenL" wrote in message
...
I have two rows of dates, row A - "Start" date & row B - "Due" date. In

cell
A1 user can select a start date from the range in row A below. There will

be
multiple lines that have same "Start" date but the "Due" date could vary.

I
would like the MIN "Due" date value to appear in B1 based on the
cooresponding "Start" date user chooses in cell A1.
ie.
A1. user chooses start date / B1. MIN value row B appears
A2. 12/1/5 B2. 12/4/5
A3. 12/2/5 B3. 12/6/5
A4. 12/3/5 B4. 12/6/5
A5. 12/3/5 B5. 12/5/5
if user chooses start date of 12/3/5 the MIN value within row B range is
12/5/5. Can someone help me write a formula for B1.
Thanks, Steven



  #3   Report Post  
CLR
 
Posts: n/a
Default

If you would sort your data using column A as the primary key ascending and
column B as the secondary dey ascending, then the following in B1 will
do........(ranges based on your sample data, change as required)

=IF(AND(ISNUMBER(A1),A1=MIN(A2:A5)),VLOOKUP(A1,A2 :B5,2,FALSE),"No
acceptable date in A1")

Vaya con Dios,
Chuck, CABGx3


"StevenL" wrote in message
...
I have two rows of dates, row A - "Start" date & row B - "Due" date. In

cell
A1 user can select a start date from the range in row A below. There will

be
multiple lines that have same "Start" date but the "Due" date could vary.

I
would like the MIN "Due" date value to appear in B1 based on the
cooresponding "Start" date user chooses in cell A1.
ie.
A1. user chooses start date / B1. MIN value row B appears
A2. 12/1/5 B2. 12/4/5
A3. 12/2/5 B3. 12/6/5
A4. 12/3/5 B4. 12/6/5
A5. 12/3/5 B5. 12/5/5
if user chooses start date of 12/3/5 the MIN value within row B range is
12/5/5. Can someone help me write a formula for B1.
Thanks, Steven



  #4   Report Post  
StevenL
 
Posts: n/a
Default

Thanks Chuck, but relying on others to fill in the data and can expect no
consistency. The formula will be for multiple others and not always there to
explain below. I need to stay away from index and Vlookup formulas.

Brgds and thanks for the quick response.
Steven


"CLR" wrote:

If you would sort your data using column A as the primary key ascending and
column B as the secondary dey ascending, then the following in B1 will
do........(ranges based on your sample data, change as required)

=IF(AND(ISNUMBER(A1),A1=MIN(A2:A5)),VLOOKUP(A1,A2 :B5,2,FALSE),"No
acceptable date in A1")

Vaya con Dios,
Chuck, CABGx3


"StevenL" wrote in message
...
I have two rows of dates, row A - "Start" date & row B - "Due" date. In

cell
A1 user can select a start date from the range in row A below. There will

be
multiple lines that have same "Start" date but the "Due" date could vary.

I
would like the MIN "Due" date value to appear in B1 based on the
cooresponding "Start" date user chooses in cell A1.
ie.
A1. user chooses start date / B1. MIN value row B appears
A2. 12/1/5 B2. 12/4/5
A3. 12/2/5 B3. 12/6/5
A4. 12/3/5 B4. 12/6/5
A5. 12/3/5 B5. 12/5/5
if user chooses start date of 12/3/5 the MIN value within row B range is
12/5/5. Can someone help me write a formula for B1.
Thanks, Steven




  #5   Report Post  
StevenL
 
Posts: n/a
Default

Thanks Max, worked like a charm.
Best Regards,
Steven

"Max" wrote:

One way .

Put in the formula bar for B1 and array-enter
(i.e. press CTRL+SHIFT+ENTER):
=IF(A1="","",MIN(IF(A2:A100=A1,B2:B100)))

--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"StevenL" wrote in message
...
I have two rows of dates, row A - "Start" date & row B - "Due" date. In

cell
A1 user can select a start date from the range in row A below. There will

be
multiple lines that have same "Start" date but the "Due" date could vary.

I
would like the MIN "Due" date value to appear in B1 based on the
cooresponding "Start" date user chooses in cell A1.
ie.
A1. user chooses start date / B1. MIN value row B appears
A2. 12/1/5 B2. 12/4/5
A3. 12/2/5 B3. 12/6/5
A4. 12/3/5 B4. 12/6/5
A5. 12/3/5 B5. 12/5/5
if user chooses start date of 12/3/5 the MIN value within row B range is
12/5/5. Can someone help me write a formula for B1.
Thanks, Steven






  #6   Report Post  
Max
 
Posts: n/a
Default

Glad to hear that, Steven !
Thanks for the feedback ..
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"StevenL" wrote in message
...
Thanks Max, worked like a charm.
Best Regards,
Steven



  #7   Report Post  
StevenL
 
Posts: n/a
Default

Max, I left one thing out... there are two cells for the user to set
criteria. A "Start" and "End" date.
A2:A100=A1
and
A2:A100<=B1

Don't suppose you have a solution? (thought I'd be able to sort this out
myself)
Rgds, Steven

"Max" wrote:

One way .

Put in the formula bar for B1 and array-enter
(i.e. press CTRL+SHIFT+ENTER):
=IF(A1="","",MIN(IF(A2:A100=A1,B2:B100)))

--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"StevenL" wrote in message
...
I have two rows of dates, row A - "Start" date & row B - "Due" date. In

cell
A1 user can select a start date from the range in row A below. There will

be
multiple lines that have same "Start" date but the "Due" date could vary.

I
would like the MIN "Due" date value to appear in B1 based on the
cooresponding "Start" date user chooses in cell A1.
ie.
A1. user chooses start date / B1. MIN value row B appears
A2. 12/1/5 B2. 12/4/5
A3. 12/2/5 B3. 12/6/5
A4. 12/3/5 B4. 12/6/5
A5. 12/3/5 B5. 12/5/5
if user chooses start date of 12/3/5 the MIN value within row B range is
12/5/5. Can someone help me write a formula for B1.
Thanks, Steven




  #8   Report Post  
Max
 
Posts: n/a
Default

With the start and end dates in A1 and B1,

Try this revised formula in C1 (array-entered as before):
=IF(OR(A1="",B1=""),"",MIN(IF((A2:A100=A1)*(A2:A1 00<=B1),B2:B100)))

Adapt the ranges to suit ..
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"StevenL" wrote in message
...
Max, I left one thing out... there are two cells for the user to set
criteria. A "Start" and "End" date.
A2:A100=A1
and
A2:A100<=B1

Don't suppose you have a solution? (thought I'd be able to sort this out
myself)
Rgds, Steven



  #9   Report Post  
StevenL
 
Posts: n/a
Default

Again, worked liked a charm. Thanks for your help MAX!

Best Regards

"Max" wrote:

With the start and end dates in A1 and B1,

Try this revised formula in C1 (array-entered as before):
=IF(OR(A1="",B1=""),"",MIN(IF((A2:A100=A1)*(A2:A1 00<=B1),B2:B100)))

Adapt the ranges to suit ..
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"StevenL" wrote in message
...
Max, I left one thing out... there are two cells for the user to set
criteria. A "Start" and "End" date.
A2:A100=A1
and
A2:A100<=B1

Don't suppose you have a solution? (thought I'd be able to sort this out
myself)
Rgds, Steven




  #10   Report Post  
Max
 
Posts: n/a
Default

You're welcome !
Thanks for posting back ..
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"StevenL" wrote in message
...
Again, worked liked a charm. Thanks for your help MAX!

Best Regards



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
Date/time range based calculations jim314 Excel Discussion (Misc queries) 1 April 28th 05 07:21 PM
Count cells in one range based on parameters in another range dave roth Excel Worksheet Functions 2 March 29th 05 05:33 PM
How can I assign a range starting cell based on a variable locati. feman007 Excel Worksheet Functions 3 March 9th 05 11:40 PM
Define a range based on another named range Basil Excel Worksheet Functions 2 February 21st 05 01:47 PM
Function that filters a list (Database) for criteria in a range a. FirstVette52 Excel Worksheet Functions 0 February 8th 05 04:37 PM


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