Excel: Find if cell is >= or <= of an array of dates - excel

I have made a dynamic calendar here: Please copy and paste for testing
The calendar currently uses VLOOKUP formulas (and more) to find guests checking into a property and lists information associated with their stay such as number of nights and their contact details. All of this is derived from a list shown to the right. Yes, it does contain
The date can be changed in cell B3 to the first of each month to view new guests checking in each month.
I now need to create conditional formatting formulas to alter the colour of the 3 cells spread across each day. You will see 7th December 2019 has the first cell in green, second white and 3rd red. I have created a formula to detect if the date (always right most cell) is contained in the range X5:AF13. This formula will not work if the check-in date is any other day than a Saturday. The 'prototype' formulas created so far are illustrated below.
I need to construct a new formula that will work so the date (07, 08, 09 etc) is searched against the occupied days/nights in the range X5:AF13 shown in pink. My proposed method is to cross reference (VLOOKUP) the date against the days/nights which the property is occupied for. I need to find the SUM([Date2]+[Nights]-1) to find the check-out date and somehow find if the date shown in the calendar is >= or <= to any of dates between check-on and check-on with the list in pink.
Is VLOOKUP the right forumla or is MATCH or even a combination with IF(AND( and SUM(? Slightly stuck...

Related

VLOOKUP to find weeknumber

I'm sure there is a more appropriate method for this, but I have layers of referencing so it has to be done this way. My spreadsheet is like an onion.
I need to be able to pull the week number based on a value defined in another sheet. So far the user enters the date when they start the sheet up. It is always the 1st of the month. This is then reference for a host of things elsewhere. This value is currently in =Front!$C$3. I have a visual calender set up as 53 rows, with 1 row per seven day period. I had written =VLOOKUP(O25, $S$2:$Z$54, 1, FALSE ) which had worked on a two column table for another task with different referencing. Currently I get #N/A as the return.
I'm assuming there is a way to have the cell check the red area for a value matching 1/1/23 (formatted as a custom format to just show the day number) and return the value in column 1 (the week number)
In my case O25:O36 is just 1/1/23:1/12/23. N25:N36 is the same just referencing the adjacent cell for O.
If there is a more straight forward way of having a cell return the weeknumber for the first day of each month, so I can have a cell on Front! return the week number based on the value in =Front!$C$3 that would be ideal also.
Thanks for the second time to #FoxfireAndBurnsAndBurns again, for pointing out a simple answer. ISOWEEKNUM with the dates of the first of the month has resolved.
=ISOWEEKNUM("1/1/23")

Pull named range from cell value

I have a spreadsheet used to generate monthly job cards. I need to set it up so it "knows" which month it's on, and on which day number a Monday falls. To this end I have set it up that each day number for every monday this year is listed. Each line on the daily task jobcard is serial numbered from 1 to 28,30, or 31 dependant on the month, so I have set up a formula to check the serial number for the daily task against the day number of each Monday. It works and I have checked this, but the only issue I have is that the formula (=IF(COUNTIF(MARCH23MON,AJ6)>0,$AK$4,$AK$5)) requires me to change the MARCH23MON to match the range for each month up to 31 times every month.
Is there a way to do something like if the date = the date listed in cell a1, then use the value of cell b2 as the range (i.e. MARCH23MON).
See the screenshot here to see how I have begun to set this out. The date for each month is defined by the user in cell C3 when they generate the job cards for the upcoming month, this is then copied into cell AJ2 and formatted to match the dates in AP3:AP14.
I'd like to have the date defined in AJ2 to define the range the formula in AN6:AN36 uses from those listed in AO3:AO14, so that each month is checked against the relevant range of dates.
I had attempted to just use a vlookup then reference the output in this formula =IF(COUNTIF(MARCH23MON,AJ6)>0,$AK$4,$AK$5) as follows =IF(COUNTIF($AL$2,AJ6)>0,$AK$4,$AK$5) which obviously doesn't work. I tried it as ADDRESS($AL$2) but again no worky. Not sure if it is possible.
Foxfire and Burns And Burns mentioned the CHOOSE function in a comment, and that has resolved this for me. Instead of using the list of range names I am now using CHOOSE
to select the dates of each month's Mondays from individual lists. I get the value of AL2 from a VLOOKUP function.

How to select a cell based on the current month in excel

I'm looking for some excel help.
I am trying to make a total cell that changes the value selected based on what month it currently is. Basically in the image the left cell indicates the $ amount for that month and that $ amount is in the cells on the right.
For example I want the total cell (not shown in the screenshot) to show 15363.21 from March 1 to 31st, and then change to 15388.81 on April 1st.
I have done some research but can't get this to work for me.
Pretending month is march Pretending month is April
It seems like you are asking for a lookup: "find the single cell in Column A that contains the current month and year, then return the corresponding single cell in Column F."
There are several ways to do this, but assuming your Excel version supports XLOOKUP, the code to place inside your total cell could be:
=XLOOKUP(1,(MONTH($A$4:$A$11)=MONTH(TODAY()))*(YEAR($A$4:$A$11)=YEAR(TODAY())),$F$4:$F$11)

Guide me Regarding Compare the Value of Cell contain date and other cell contain Drop down list

Hy Every One, I need help in excel formula, I have two sheets, sheet1 for sale tracker, sheet two for goals tracker, I used Now() to enter date automatically, and its working fine, Next in goal sheet, I use =Sumif() to calcualte various category totals and refer them in cell. Its also working fine. But I want to track record according to month and category. Like I have 6 categories detail is as under,
Sales Tracker
In the First picture Column Date consist of formula "=IF(ISBLANK(B5),"-",TODAY())" and it display the name of month like "October"
While in second picture there is a drop down list of "Month" Column.
1- I want to use if statement like =if(Date=Month, Sum(Revenue Secure column Data), "-") But its not working the formula I wrote here is an example....
2- I want when I select any month from second sheet like January, February, It should calculate sum from picutre one data and only show the sum of january etc.
Please help me, this is eating my brain a huge,,,,,,:)
Thanks in advance....
In short my question is how can I use If statement to compare value of cell that contain formula and other that contain drop down list?
Or use the MONTH function to change your date to a number 1 to 12 corresponding to the month. Then have the combo return a number for the month chosen. It might be faster using integers than test
I Believe you have to compare the month and not the whole date.
You can do TEXT(NOW();"mmmm") to get the full month name of the current data (in the language of excel) and then compare it to your drop down.
If you replace the NOW() with any data it works as well.

Excel Advanced Filtering Issues - Advice Needed

So basically I have a main table, and I want to filter that data to another table (normally easy) but I want this based upon 2 criteria. e.g. I want to filter the data of a specific department but only for the current month. The way I display the current month in the main table is by inserting the date from a userform and then by formatting that cell to just display the month. However, when using advanced filter I use the column headings that I want to filter e.g. department: mens, month: november (worked out using =now() then formatting to just display the month) but when I'm running the filter it's not picking out the information at all.
I think this lies with the way the month is worked out and displayed but I can't figure out another way to do this. Any help is greatly appreciated.
I'm also open to trying a new method of just selecting data for the current month if anyone has a cleaner way, as I'm sure there is one.
You have to use a formula in your criteria to specify what month you want to extract. But it's not terribly intuitive. Take a look at this sample. My starting list is the range A1:B7. My criteria is in range D1:E2. The Department is straightforward; I just entered "3". (Obviously, without the quotes.) But instead of a Month criteria, I added "GetMonth" and entered the formula shown in the formula bar. You can name this whatever you want, but it can't be the same as one of the headers in your source list. (Yeah, I checked.) The formula checks to see if the current month of the date in cell B2 is 12, which is December, and returns TRUE or FALSE. You could use 11 for November. The advanced filter will apply the reference to cell B2 that's in the formula in a relative fashion to all cells in the Month column. And Viola! my output in range A10:B11 is what you'd expect it to be.

Resources