Search Range For Current Month & Year Return Corresponding Values
Nov 21, 2007
I have a workbook with two spreadsheets in it. On the second sheet there is a large table, which column headings are months and years (e.g. Jun-07 Jul-07, Aug-07, Sep-07....). I was trying to write an excel vba code that would search the first row (column headings) to find the current month and year, and copy the corresponding column along with two previous columns (months) to the first sheet. I would like to have a code that will be able to do this in Jan-08, Feb-08, or Jan-09 as well.
View 2 Replies
ADVERTISEMENT
Sep 25, 2006
I have two combo boxes: One for entering the Year, and one for the month. I can produce a message if the user leaves either box blank but I want a message to apear it the user selects a year AND month less than the current year (iYear) and current month (iMonth). I therefore need an AND statement between the two criteria but i dont know how to do it.
'....First Checks the Comboboxes arent blank then below Checks a future month/year secection is chosen
ElseIf YearBox.Value = iYear & iMonthbox < iMonth Then
MsgBox ("You may not enter Data before the current Month")
Else '...... Run main code here
View 3 Replies
View Related
Mar 8, 2014
I am working on a budget for myself and want it to have running dates so the first data column will have the current month. I was able to succeed with this using the EOMONTH function followed by EDATE functions in the following cells, I then have these columns filled using a nested VLOOKUP MATCH function pair.
The problem I run into is with the months that extend into the next year, in my data table I have month by month listed started on 01/01/2014 ending 12/01/2014 but as soon as the month is no longer January the last column in my budget cannot find the information needed due to it looking for 2015. so what I would like to know is if there is a way to make the data table change the year to the following year after today is beyond that month, so for example on March 1 2014 both January and February would be changed to 2015.
Attached is an example : Budget Example.xlsx‎
View 4 Replies
View Related
May 14, 2009
I have dates in my column “A”, for example (A1 cell =22-Mar-1971), (A2 cell=30-Dec-1965). Now my requirement is in B column date and month from A column and year should take current year. Output in B column (B1 cell =22-Mar-2009), (B2 cell=30-Dec-2009)
View 3 Replies
View Related
Jan 20, 2010
I want to use a COUNTIF to return the sum of all the dates that fall within a given month/year. For example: E1 Contains the date July-2009
Column A has date entries such as July 3, 2009, July 18, 2009, August 4 2009. In F1 I want to return the sum of all dates that fall within the month of E1.
View 4 Replies
View Related
Mar 6, 2014
I am a memeber of this forum for more than a year, and currently assign into a new assignment which dealing an excel file everyday. We have one excel file for moniroting of action items generated by the management after the study. As since there were around 2,500+ rows has been generated since in the beginning of 1990's till todate. So I was thinking of instead of getting the result through filter manually, I want to create a formula that will count of how many has been closed this month out of the total numbers of action items.
Is it possible to use the COUNTIF formula to count the number of items in Col C, where Col B contains a date?
2-Jan-13 Closed
2-Jan-13 Closed
5-Jan-13 Closed
19-Feb-13 Closed
16-Feb-13 Closed
22-Feb-13 Closed
2-Mar-14 Closed
5-Mar-14 Closed
8-Mar-14 Closed
10-Mar-14 Closed
15-Mar-14 Closed
View 10 Replies
View Related
Dec 3, 2008
I'm calculating sick days on an Attendance Report.
- Sick days accumulate at a rate of 1.25 per month.
- Employees will carry-forward unused sick days from 2008.
- The maximum sick days is 30.
In trying to create a formula that will multiple the current month (eg Dec=12) by 1.25, subtract any sick days taken YTD (S16), and add the carry-forward days from 2008 (W16), I noticed one problem with the following formula:
View 2 Replies
View Related
Mar 23, 2009
finding a code that would automatically insert various phrases into a column depending on whether or not the person in that row was due to renew their membership in our organization. The code I received works fantastically, but I've come across one snafu:
View 3 Replies
View Related
May 3, 2008
I am trying to get mmm-yy date format for the next 2 consecutive months from now. I used the following code for that reason, but I am not getting.
strDate = Format(DateAdd("m", 1, Date), "mmm-yy")
strDate = Format(DateAdd("m", 2, Date), "mmm-yy")
However if I use this, I get the current months date correctly (like May - 08)
strDate = Format(DateAdd("m", 0, Date), "mmm-yy")
View 9 Replies
View Related
May 9, 2014
I use this formula to count number of entries month wise.
Following example is for Month of Feb.
How can I convert this to count entries for current year ( of course month wise).
View 9 Replies
View Related
Feb 29, 2012
I've got a formula that has numerous nested IF statement and am trying to get the true result to be the first of a given month of the current year. Here's my formula:
Code:
=IF(Setup!$B$3="X","1/1",IF(Setup!$C$3="X","2/1",IF(Setup!$D$3="X","3/1",IF(Setup!$E$3="X","4/1",
IF(Setup!$F$3="X","5/1",IF(Setup!$G$3="X","6/1",IF(Setup!$H$3="X","7/1",IF(Setup!$I$3="X","8/1",
IF(Setup!$J$3="X","9/1",IF(Setup!$K$3="X","10/1",IF(Setup!$L$3="X","11/1",IF(Setup!$M$3="X","12/1",""))))))))))))
Everything works, save that the cell becomes 1/1 with no year at all. I've messed around a bit with TEXT and various DATE/MONTH/YEAR functions on this one, but can't seem to get it correct.
View 6 Replies
View Related
Apr 3, 2014
In sub which will convert file to PDF and save it to assigned folder and then attach it to email in outlook. All works fine.
However is is possible to modify the code to save fole to respective month folder ( as per current date and year)?
e.g. I have created folder Named 'Trial' in C drive . This has sub folders 2014, 2015, 2016, 2017, 2018 Each year folder will have sub-sub folders month wise like This has sub folders as Jan , Feb , Mar , Apr .... till Dec Now e.g. if date when the pdf was created is 23/4/14 then it is saved in C:Trials2014Apr automatically. Currently every year I keep creating new folders etc... bit primitive though.
View 2 Replies
View Related
Mar 28, 2014
I am trying to write a macro but I got a little stuck. Basically on row 6 I have the months listed out (so like Jan Feb Mar etc), and i would like my macro to dynamically search the the cell of current month and select it.
I know the cell formula for current month (ie. "Mar") is =TEXT(TODAY(),"MMM"), but is there a way to incorporate it into a search command in macro, or do I have to insert the formula into another cell and ask the search function to search for the text value in such "dummy cell"?
Another thing to note is, I do have more of "Mar"s scattered around the sheet, but if I limit my search area to row 6 there is only one, and that's the one I need to select.
View 2 Replies
View Related
Mar 20, 2009
I have log data in two columns:
Column A: Date/time (at 30 minute intervals)
Column B: Numeric data
On the last row of each month, I’m trying to perform a SumProduct on the two columns and display that result in column C.
The end of the range is determined by the month in the current row.
I’m having difficulty finding the beginning of the range, though. I need to account for both the normal dynamic calendar days & the fact that I may get data starting mid-day and mid-month.
I have this formula, but I’m not sure how to make the first array dynamic or if this is even correct approach.
Manual
=IF(OR(MONTH(A1009)=A4)*(A$4:A$65536
View 9 Replies
View Related
Mar 27, 2014
I have a sheet with the following values:
280315 085B 10:24 2R
The '085' is the 85th day of the year. I would like a formula that reads that part of the data, and return the month that day is in, in the "jan", "feb", "mar", etc. format.
View 14 Replies
View Related
Aug 9, 2013
I have the following code, which I used to search Column A for a date and then copy the adjacent cell next to the date and paste it to sheet2.
However what I want to do now is be able to enter just the month or the year and the code will find the cells that contain the same year or month that I entered. I know to find a string value in a cell I can use InStr() however I don't know how to implement this into the code that I have, As depending on the month that I select I want the code to put the value in a certain cell.
Here is the code that I have so far
Code:
Sub SearchMacro()
DateSearch.Show
Dim LR As Long, i As Long
With Sheets("Sheet1")
LR = .Range("A" & Rows.Count).End(xlUp).Row
[Code] ......
How I can do this by edited the current code or any code for that matter.
View 9 Replies
View Related
Feb 15, 2008
I have a workbook that has rows of data starting at A5:G5 seperated in groups of 25 rows.
Example: A5 is numbered 1 and A6 is 2 A7 is 3 and so on to 25 then skip a row and start numbering again to 25.
What this is for is employees are placed in groups of 25 to be eligible for an award for safety.
What I want to do is Range G5:G650 is to be a place where an "X" is placed beside an employee who has had an accident then Range H5:H650 would return "Employee had an accident" I already have this part working.
Then I want to code a subroutine that would search for the "X's" and return the entire row data for each name in that group of 25 on a seperate worksheet.
This would then be printed so we would know which group's to exclude.
I know how to make it return the row of data containing the "X" but how can I make it grab the entire group?
There will be multiple groups of 25 each and each time an "X" is found within a group create a new worksheet for that group.
650 employees / 25 = 26 groups
View 14 Replies
View Related
Jan 21, 2009
formula off here i use all the time relating to finding and sumproducts for specific months and years i.e.
Jan 2008, Dec 2007.. depending on these dates excel searched through a specified range and returned me any values i wanted like No. of occurences, totals, sums etc etc it was a sumproduct formula...
is there any way i could specifiy a date i.e. Jan 2009, which would search column a and return the date /and/or an account number in column b, only if the date was during jan 2009?
The reason i want this is to use a lookup on the account numbers to return specific items of info, but i only need the account numbers if they occurred in specific months which i want to choose.
View 9 Replies
View Related
Dec 17, 2009
In attached sheet, I am trying to find total cost by month only for year 2009. Currently formula I have in Cell c24, is {=SUM(IF(MONTH(B2:B9)=1,D2:D9,0))} But this calculates for all years, not just 2009. How do I modify above formula, so for each month, it shows total cost but only for 2009?
View 2 Replies
View Related
Apr 3, 2014
In cell b2 I have a formula =text(today(),"yyyy") which daisplays todays date as a year, in cell b3 I have =text(today(),"mmmm") which displays todays date current month.
I have a column of Months and Years
January 2014
February 2014 etc
I need todays (current) month and year to indicate in a helper column next to the relevent month and year as a number 1 to use as a reference to return date from the row where the 1 is displayed, I have tried =if(and(b2=a10,b3=b10),1,"")) and it dosent like the fact that the year in the colmuns is entered as standard text, is there any whay to do this?
View 8 Replies
View Related
Feb 22, 2014
get the current month name in a Cell A1 and Next month name in Cell B1. what formula should I used? This will be a part of the macro that I'm creating.
The macro will be use every 11th to the last day of the month so I want the formula to be dynamic enough to work in each day the macro will be use.
Expected result using the current Date Today
A1 B1
February March
View 2 Replies
View Related
Feb 26, 2012
I have 1 cell where i am entering month like 2 (for FEB) and in other cell i am putting value 2012 (year)
I have 1 more cell where i have to manually add 1st date of the month like: 01-02-2012
Can I merge first two values and let excel automatically return 01-02-2012 in my desired cell.
Also if i need to convert 02 to FEB or 03 to MAR then what is the formula for this.
View 6 Replies
View Related
Aug 15, 2014
I have a table with columns 'Date', 'Account', 'Sales'.
I need a formula that will give me the given sales for a certain month, for a certain account.
Ive tried various SUMIFS '=SUMIF(Table1[Billing Month],(MONTH(A191)&YEAR(A191) = MONTH(Table1[Billing Month])&YEAR(Table1[Billing Month])),Table1[Net Invoice Value])'
Ive looked at Arrays =SUM(IF(MONTH($A$2:$A$6)=1,$B$2:$B$6,0))
View 1 Replies
View Related
Jan 2, 2013
As in the attachment example, I use a database (sheet2, where data start from row 3, and headers are in rows 1,2). I've named it as "Data" with a dynamic range name (formula: FFSET(Sheet2!$A$3;0;0;COUNTA(Sheet2!$A:$A)-2;COUNTA(Sheet2!$2:$2)). When I enter a month and a year, in sheet1, I want to get for that year's month:
1) The working days
2) The sums of the fields Totals and each of the other (AA, BB, CC etc.).
View 2 Replies
View Related
Sep 29, 2009
Please refer to attached worksheet.
I have a value that has a whole number and a decimal. From this number I need to figure the Year and month. The worksheet has constant values from which this can be determined.
View 9 Replies
View Related
Aug 20, 2013
Basically, I'm doing a recorded macro for work where I take an export and manipulate the data to show differences between sales from last year and this year. Also comparing this months projected sales to avg of last 6 months and also against last years this month.
The problem I'm running into is in automating the this month sales for mid-month exports. I can do it individually but I can't find a formula that will do it. Data is in one cell per month, so ex. 130 sales this month so far. I need to have it convert that to projected sales for total month based on what day it currently is.
View 1 Replies
View Related
Sep 14, 2009
How can I search a range of cells that have a date entered by hand for a certain month and then sum the amounts given in another range of cells. For example, search several worksheets for payments made in September and then return the sum of those payments.
View 3 Replies
View Related
Aug 20, 2013
How to get only MONTH' YEAR if there is a DATE-MONTH-YEAR in a cell?
A1: 27-July-2012
Answer D1:JULY' 2012
Pl note "' " is suffixed after JULY (the month).
View 4 Replies
View Related
May 8, 2008
I collect unique prices each day. I am trying to find a way to determine the average of the numbers collected from the 21st of the previous month to the 20th of the current month. This formula will need to calculate for multiple months and years. So for example, I need Feb2008 average-which would be the average of numbers found between Jan21-Feb20, I then need Mar 08 average which would be data from Feb21-Mar20 etc. My spreadsheet is setup with the first column having the dates (ex. 01/01/08, 01/02/08 etc) and the second column containing the value for that particular date ($2.85, $3.00 etc).
As the number of days between the 21st and 20th change each month, I just can't seem to find a way to do it without a whole lot of manual effort.
View 9 Replies
View Related
Jan 9, 2007
I need to compute the number of days that a given range of dates has in common with any given month. So an example might be:
Cell A1: Range Start Date (say it's 1/1/07)
Cell A2: Range End Date (say it's 2/15/07)
Cell A3: Month Indicator (say it's 2, meaning February)
Cell A4: Days of Intersection (should be 15 in this case, meaning that 2/1-2/15 were the days of February that were also in the range 1/1-2/15)
Cell A4 is what I'm trying to create the formula for.
I'm in Excel 2000 and am having trouble installing the add-on.
View 9 Replies
View Related