Extracting data based on date

mattyn

Board Regular
Joined
Apr 20, 2015
Messages
148
Hi All

Firstly I hope everyone is staying safe and well.

Todays problem - straightforward spreadsheet that identifies a student accommodation planner. A number of worksheets for a number of accommodation venues.

Each worksheet consists of Columns A to L with specific info about the particular accommodation and its resident.

Col M onwards is the date planner - with each column as one day - and Row 9 has the date - so M9 is 1 Jun 20, N9 is 2 Jun 20 etc. The student and accom details are from row 10 onwards, and the accommodation team populate columns m onwards with a R if the student is resident in the block. I use =countif(M10:M500,"R")

Col M6 onwards count how many residents are in the accommodation for that day.

I want a Headlines Front Page that tells me the total # of residents in each venue today, in 7, 14, 21 days time - as a forecast.

So as columns on the headlines page - I need under the following headers:

Accom VenueTotal capacityResident TodayResident + 7 daysResident +14 daysResident +21 Days
TextTextto be pulled from the ind worksheet count for todaypulled from the ind worksheet count for today + 7pulled from the ind worksheet count for today +14pulled from the ind worksheet count for today +21

Have no idea if this is possible - would appreciate some guidance please. Just hope this makes sense.

Very many thanks and kindest regards

matt
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hey Mattyn-

You explain in detail but I couldn't get everything. could you share sample file input file with target output.

whatever it is can be done.






 
Upvote 0
Hi - and thank you so much for picking this up. Can't add the file as it is on work PC but hopefully show well enough in a table.

So - main worksheet called "ACCOM"- all typed in static data. The rows of Days and dates goes on rightward for ever!! I have Freeze Panes just under 1 Jun 20 - and there are over 1600 rooms listed down the left side.

MonTueWedThu
NameEntry DateLeaving DateAccom Number1 Jun 202 Jun 203 Jun 204 Jun 20
Joe Smith2 Jun 2020 Jun 201-1-1EOOO
Bob Colgees30 May 2020 Aug 201-1-2OOOO
James Bond1 Jan 202 Jun 201-1-3OEEE
1-1-4EEEE
1-1-5RRRE
Where E = Empty, O = Occupied, R = Under repair

I would like a HEADLINES worksheet that gives the general accommodation status, pulling and calculating data from the ACCOM worksheet as follows: (Have reviewed the headers as follows - ideally needs to be only these four - and not static dates as above).

=Today()=Today()+7=Today()+30=Today()+60
Occupied Roomscount the columns that are indicated "O" under todays datecount the columns that are indicated "O" under todays date + 7 dayscount the columns that are indicated "O" under todays date + 30 dayscount the columns that are indicated "O" under todays date + 60 days
Empty Roomscount the columns that are indicated "E" under todays datecount the columns that are indicated "E" under todays date + 7 dayscount the columns that are indicated "E" under todays date + 30 dayscount the columns that are indicated "E" under todays date + 60 days
Rooms Under repaircount the columns that are indicated "R" under todays datecount the columns that are indicated "R" under todays date + 7 dayscount the columns that are indicated "R" under todays date + 30 dayscount the columns that are indicated "R" under todays date + 60 days

I hope this explains what I am trying to do.

Many many thanks again for helping - it is really much appreciated.

Matt
 
Upvote 0
okay.. so here is the formula which could bring the required details.


Rich (BB code):
formula to get details for "Today"
-----------------------------------------------------------------------------
=COUNTIFS(INDEX(ACCOM!$2:$1048575,,MATCH(TODAY(),ACCOM!$2:$2)),"O")

ACCOM!$2:$1048575    --- >  this is the full range for your data in "Accom" sheet where "$2" is the  row which contains "Date" and $1048575  is nothing but last row.


TODAY() - - today date

ACCOM!$2:$2  --- > again row which contains the Date


,"O" ---> Criteria which represent Occupied

---------------------------------------------------------------

Do TODAY() + 7 , TODAY() +30 and TODAY() +60 for all other 3 columns, rest formula would be same.


revert back in case of any doubt.
 
Upvote 0
Hi Mukeshy12390

Absolutely awesome - thank you so much.

Another Q if I may.

I want to duplicate in cell E3 (under Status) whatever the accommodation state is for today: e.g.


TueWedThu
NameEntry DateLeaving DateAccom NumberStatus2 Jun 203 Jun 204 Jun 20
Joe Smith2 Jun 2020 Jun 201-1-1duplicate whatever is in this row under today() --->OOO
Bob Colgees30 May 2020 Aug 201-1-2 "OOO
James Bond1 Jan 202 Jun 201-1-3 "EEE
1-1-4 "EEE
1-1-5 "RRE

If that makes sense...??

VMT

Matt
 
Upvote 0
I'm glad it worked out.

I want to duplicate in cell E3 (under Status) whatever the accommodation state is for today: e.g.

I didn't understand , could give another example.
 
Upvote 0
Hi MUKESHY12390

Hopefully this explains better.

Under each date and against each accommodation is a status - Where E = Empty, O = Occupied, R = Under repair etc.

I want a static column that will copy the status for today - to make it easier for the user to see that status for that accommodation without scrolling across to find today within the dates.

Accomm NumberStatus Today*20 Jun 2021 Jun 2022 Jun 2023 Jun 2024 Jun 2025 Jun 2026 Jun 2027 jun 20
1-1-1OOOOOOOOO
1-1-2EEEEEEOOO
1-1-3RRRRREEEO
*copied from the corresponding cell on this row under todays date. Therefore tomorrow (24 Jun 20) it will show:

Accomm NumberStatus Today20 Jun 2021 Jun 2022 Jun 2023 Jun 2024 Jun 2025 Jun 2026 jun 2027 Jun 20
1-1-1OOOOOOOOO
1-1-2EEEEEEOOO
1-1-3ERRRREEEO

Does that explain better?

Matt
 
Upvote 0
got it, there are several ways you can do it.

this is one of the.

=HLOOKUP(TODAY(),$2:$1048576,ROWS($E$2:E2)+1,0)

$2:$1048576 ---> Entire data range including Date header

ROWS($E$2:E2)+1 ---> $E$2 would be Any Date cell

0 = for exact match.
 
Upvote 0
One last one (well two) - I promise.

Have added the list of residents to the worksheet which includes a column that states the date of birth of the resident in the format dd-mmm-yy. From this I would like to do two things:

One: I want to highlight (by simple colour) the surname of any of the residents that have a birthday in the next 30 days. (Surname is Col B, Date of birth is Col F)
Two: I would like a cell that calculates how many birthdays there will be from within the list of residents in the next 30 days.

Again, very many thanks in advance. You have been a great help.

Matt
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,264
Members
452,627
Latest member
KitkatToby

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top