ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Lookup date range row A and count if leave in same column on row B (https://www.excelbanter.com/excel-discussion-misc-queries/244105-lookup-date-range-row-count-if-leave-same-column-row-b.html)

Pappa

Lookup date range row A and count if leave in same column on row B
 
Hi

I am attempting in Excel 2003 to lookup a date range in row A and then count
leave booked in row B. e.g.
01 02 03 04 05
TIM L L L
KIM L L

Count leave for Tim period 02 to 04 inclusive. (L's for leave could be
replaced with numeric)

Please note that

1. The date range would be entered in two seperate cells not directly into
the function.
2. The date period in row A would be running for a year so any function
would need to search the entire period.
--
Cheers
Pappa Smurf

Ms-Exl-Learner

Lookup date range row A and count if leave in same column on row B
 
Just try this...

=COUNTIF(B2:F2,"L")

Change the Cell reference B2:F2 to your desired range.

If this post helps, Click Yes!

--------------------
(Ms-Exl-Learner)
--------------------



"Pappa" wrote:

Hi

I am attempting in Excel 2003 to lookup a date range in row A and then count
leave booked in row B. e.g.
01 02 03 04 05
TIM L L L
KIM L L

Count leave for Tim period 02 to 04 inclusive. (L's for leave could be
replaced with numeric)

Please note that

1. The date range would be entered in two seperate cells not directly into
the function.
2. The date period in row A would be running for a year so any function
would need to search the entire period.
--
Cheers
Pappa Smurf


Pappa

Lookup date range row A and count if leave in same column on r
 
Sorry but I mucked up what I meant was row 1 and 2 not A and B.

Ms-Exl-Learner- This will count the L without any reference to the date in
row 1.
I want to count for L on row 2 only if it falls within a specified date
range on row 1
--
Cheers
Pappa Smurf


"Ms-Exl-Learner" wrote:

Just try this...

=COUNTIF(B2:F2,"L")

Change the Cell reference B2:F2 to your desired range.

If this post helps, Click Yes!

--------------------
(Ms-Exl-Learner)
--------------------



"Pappa" wrote:

Hi

I am attempting in Excel 2003 to lookup a date range in row A and then count
leave booked in row B. e.g.
01 02 03 04 05
TIM L L L
KIM L L

Count leave for Tim period 02 to 04 inclusive. (L's for leave could be
replaced with numeric)

Please note that

1. The date range would be entered in two seperate cells not directly into
the function.
2. The date period in row A would be running for a year so any function
would need to search the entire period.
--
Cheers
Pappa Smurf


Pappa

Lookup date range row 1 and count if leave in same column on row 2
 
Sorry I mucked up and meant row 1 and 2 not A & B.

Ms-Exl-Learner - The count you suggested will count the L's without
reference to the specified date range.

--
Cheers
Pappa Smurf


"Pappa" wrote:

Hi

I am attempting in Excel 2003 to lookup a date range in row 1 and then count
leave booked in row 2. e.g.
01 02 03 04 05
TIM L L L
KIM L L

Count leave for Tim period 02 to 04 inclusive. (L's for leave could be
replaced with numeric)

Please note that

1. The date range would be entered in two seperate cells not directly into
the function.
2. The date period in row A would be running for a year so any function
would need to search the entire period.
--
Cheers
Pappa Smurf


Max

Lookup date range row 1 and count if leave in same column on r
 
Real dates are assumed in B1:Z1 with corresponding data ("L"s, etc) in B2:Z2
down
Date range desired: Startdate is specified in AA1, Enddate in AA2 (these 2
dates must be real dates)
In AA2:
=SUMPRODUCT(($B$1:$Z$1=$AA$1)*($B$1:$Z$1<=$AB$1)* (B2:Z2="L"))
Copy down to return the required counts of "L"

If data within B2:Z2 down are numbers (instead of the letter L)
and you want to sum up these numbers instead for the specified date range,
use in AA2, copied down:
=SUMPRODUCT(($B$1:$Z$1=$AA$1)*($B$1:$Z$1<=$AB$1), B2:Z2)

Above any good? hit the YES below
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:27,000 Files:200 Subscribers:70
xdemechanik
---
"Pappa" wrote:
Sorry I mucked up and meant row 1 and 2 not A & B.

Ms-Exl-Learner - The count you suggested will count the L's without
reference to the specified date range


Pappa

Lookup date range row 1 and count if leave in same column on r
 
Thanks Max. Your solution not only works but is concise...simple yet effective.
I really appreciate the help.
--
Cheers
Pappa Smurf


"Max" wrote:

Real dates are assumed in B1:Z1 with corresponding data ("L"s, etc) in B2:Z2
down
Date range desired: Startdate is specified in AA1, Enddate in AA2 (these 2
dates must be real dates)
In AA2:
=SUMPRODUCT(($B$1:$Z$1=$AA$1)*($B$1:$Z$1<=$AB$1)* (B2:Z2="L"))
Copy down to return the required counts of "L"

If data within B2:Z2 down are numbers (instead of the letter L)
and you want to sum up these numbers instead for the specified date range,
use in AA2, copied down:
=SUMPRODUCT(($B$1:$Z$1=$AA$1)*($B$1:$Z$1<=$AB$1), B2:Z2)

Above any good? hit the YES below
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:27,000 Files:200 Subscribers:70
xdemechanik
---
"Pappa" wrote:
Sorry I mucked up and meant row 1 and 2 not A & B.

Ms-Exl-Learner - The count you suggested will count the L's without
reference to the specified date range


Max

Lookup date range row 1 and count if leave in same column on r
 
Welcome, good to hear

Had a typo earlier for this line:
.. Enddate in AA2


It should read:
.. Enddate in AB1


but I think you caught that <g
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:27,000 Files:200 Subscribers:70
xdemechanik
--
"Pappa" wrote:
Thanks Max. Your solution not only works but is concise...simple yet effective.
I really appreciate the help.
--
Cheers
Pappa Smurf



All times are GMT +1. The time now is 12:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com