How to select a cell based on the current month in excel - 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)

Related

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.

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

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...

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.

Making a gantt type chart in excel using if statements

So I basically have to create a gantt type chart that automatically fills in the start and end month of the project. The problem I'm having is that I have a specific start and end date like, Start: 06/17/18 and End: 07/20/19.
My Chart is categorized by months and not specific dates, so for this example I would need it to populate the cells starting from June 2018 until July of 2019.
I'm having some problems because I made an if statement that looked at the month and populated the cells by month, however, it would then only fill in the june and july cells of 2018 and 2019 and would leave all the other cells in between blank. I then added another filter for it to also look at the year, except it didn't help because since my "if statement" looks for everything in between the 6th and 7th month, it doesn't populate the 8th, 9th and other months of the rest of 2018 and the beginning months of 2019.
Here is my if statement:
=IF(AND(MONTH(N$3)>=MONTH($I5),MONTH(N$3)<=MONTH($J5), YEAR(N$3)>=YEAR($I5),YEAR(N$3)<=YEAR($J5)),"")
Here is a snippet of the work:
Make sure your month names are actually dates like 1/1/18, you can custom format them to be mmmm-yy to give January-18, then you can use the following formula.
=IF(OR($I4>=N$3, $J4>=N$3), IF(OR($I4<O$3, $J4<O$3), "inc", "ex"), "ex")
Put this in N4 then copy it to cover your range. It uses OR instead of AND to check whether either start or finish date is after or equal to the 1st of the month, likewise for less than the 1st of the next month.
The out put will give you inc for if that month is included in the dates and ex for if its excluded, so you can change either the formula or conditional formatting to colour.
This won't work on the very last column of data, so where you months end, eg December-19 you will have to put 1/1/20 in either the next column heading, or hard coded in the formula where required.
EDIT
Modified the formula as I realised you're in column I and J, not A and B.
=IF(NOT(ISBLANK($I4)), IF(OR($I4>=N$3, $J4>=N$3), IF(OR($I4<O$3, $J4<O$3), "inc", "ex"), "ex"), IF(NOT(ISBLANK($J4)), IF(AND(O$3>$J4, $J4>=N$3), "inc", "ex"), "ex"))

Excel formula to display ONLY month and year?

Looking for an excel formula that will display "13-Aug" and means August of 2013. I would ideally want to copy the "13-Aug" cell to the 11 cells on its right, incrementing the month and appropriate year each time, so it would look like:
"13-Aug", "13-Sep", ..., "13-Dec", "14-Jan", "14-Feb"
There are a number of ways to go about this. One way would be to enter the date 8/1/2013 manually in the first cell (say A1 for example's sake) and then in B1 type the following formula (and then drag it across):
=DATE(YEAR(A1),MONTH(A1)+1,1)
Since you only want to see month and year, you can format accordingly using the different custom date formats available.
The format you're looking for is YY-Mmm.
Try the formula
=TEXT(TODAY(),"MMYYYY")
First thing first. set the column in which you are working in by clicking on format cells->number-> date and then format e.g Jan-16 representing Jan, 1, 2016.
and then apply either of the formulas above.
Very easy, trial and error. Go to the cell you want the month in. Type the Month, go to the next cell and type the year, something weird will come up but then go to your number section click on the little arrow in the right bottom and highlight text and it will change to the year you originally typed

Resources