Replicating records in Excel - excel

I have a set of rows in Excel which contain data for a particular month. The month is identified by a column called 'Month' and the data in this column is in the format mm/yyyy.
Now, I would like to duplicate these records vertically for each of the next 11 months, and each time it is duplicated, the month rows should change for that month (e.g. the second time it is duplicated, the month rows should show February and then the next time March, etc.).
What's the best way to do this apart from copy and pasting 11 times and manually changing the months?

The OFFSET approach needs only two formulas copied over to a new sheet to set up the extended data set
This sample assumes
your current sheet is called sheet1
your month data mm/yyyy starts in row 2, and is in column A
Changing the sheet name and column in the two formulas below is easy, if your data to extract started on row 3 not row 2 then change all ROW()-2) to ROW()-3) etc
While the first looks messier than it really is (to add 1 month), the concept is straightforward. The OFFSET approach moves down one cell from Sheet 1 only every 12 rows, the month being tweaked each cell
In A2 put, =DATE(YEAR(OFFSET(Sheet1!A$2,INT((ROW()-2)/12),0)),MONTH(OFFSET(Sheet1!A$2,INT((ROW()-2)/12),0))+MOD(ROW()-2,12),DAY(OFFSET(Sheet1!A$2,INT((ROW()-2)/12),0)))
In B2 put, =OFFSET(Sheet1!B$2,INT((ROW()-2)/12),0) and copy over as far as you have fields

Surprisingly enough, Excel 2007 (only one I have available) understands mm/yyyy as a date, so the formula =TEXT(DATE(YEAR(A2),MONTH(A2)+1,1),"mm/yyyy") creates the next date, and can be copied down.
Duplicating other data would simply be a case of putting the values as =B2 and so forth

Related

how to count all the entries put under a row having specific days of a month

In this Sheet:
How to count all the entries (Text or Numbers) under A1 to AD1 (based on days only from Sun to Thu.) except Fri and Sat.
Note: if month is changed from list thus all the dates and days will be changed. Counting done as per changed month
Note: if month is changed from list thus all the dates and days will be changed. Counting done as per changed month
Given there are two rows at the top of the sheet, I am going to assume you want to check the contents of A3:AD3 against the day of the week in row A1:AD1
My simple answer is this formula at the end of each row (cell AF3, for example)
=COUNTIFS(A3:AD3,"=*",A1:AD1,"Sunday")+COUNTIFS(A3:AD3,">0",A1:AD1,"Sunday")+
COUNTIFS(A3:AD3,"=*",A1:AD1,"Monday")+COUNTIFS(A3:AD3,">0",A1:AD1,"Monday")+
...
You could also create a hidden helper row (let's call it AD2) that operates on the date row using the WEEKDAY() function, which will generate a number between 1 an 7 for the day of the week starting with Sunday. In this implementation, you would only need the following:
=COUNTIFS(A3:AD3,"=*",A2:AD2,"<6")+COUNTIFS(A3:AD3,">0",A2:AD2,"<6")
Another solution would be to copy/paste a similar formula across the columns at the top of the sheet (row1, for example), as follows:
=IF(WEEKDAY(A2)<6,COUNTIF(A3:A32768,"=*")+COUNTIF(A3:A32768,">0"),"")
This assumes your date is in row2 and the data entries start in row3. As rows are added to the sheet the formula will work without requiring any action. In this example I used 32768 for the max number of rows but this is arbitrary.
To get the overall total you would sum the across the columns of row1, such as SUM(1:1) or sum (A1:ZZ1) depending on the number of columns you have.

Adding values to different cells depending on conditions - Excel

I am not very good with excel formulas, and I would need some help with a process I want to implement:
Simplifying things, I have an excel sheet (sheet n°1) with rows like this:
Company name | Price | Date
On other excel sheet (sheet n°2) I have one row for every company, and in each column there are all 12 months. I would need a formula so every time I add a row in the first sheet, the price I add is automatically added to the corresponding company row and in the corresponding month (based on the date) on sheet 2
I am really lost here, I know how to apply simple formulas, but not this, is there a way to add each value to a different cell depending on some conditions?
I forgot to add, that I would need to sum this values in sheet 2, so every time I add a new value, it is summed to the actual value of the corresponding cell.
I hope my english is not to bad, and thank you in advance!! :)
Use SUMIFS()
=SUMIFS($Q:$Q,$P:$P,$A2,$R:$R,">="&EOMONTH(B$1,-1)+1,$R:$R,"<"&EOMONTH(B$1,0)+1)
One caveat to this the month headers must be an actual date in the month desired. This can be formatted any way you want to display. My cells all contain the 1st of each month as their true dates.

Excel - SUM Daily results based on given date range

thank you for taking a minute to help me!
I have 3 sheets, 3 of them with daily data of users, vehicles, and population which is steady, all of them have the same structure:
D column is location and the rest are daily results. Results change every 14 days, that's why for each location you are seeing the same data.
And there's a 4th, where I want to concentrate results from the previous sheets based on data and location - location is D column:
I want to set both start and end date and based on that, sum daily results by location. For example, suppose that Inicio - Start date is 01/03/2020 and Termino - End Date is 05/03/2020, in the second image, where I highlight SUM HERE it should appear 227,340 for 001-L1 Dr. Galvez N.
I already tried SUMIF, SUMIFS, SUMPRODUCT but it doesn´t seem to work.
Any ideas?
What didn't work with SUMPRODUCT? Try this - the result is correct:
=SUMPRODUCT((Sheet1!$E$3:$M$3>=$E$2)*(Sheet1!$E$3:$M$3<=$F$2)*(Sheet1!$D$2:$D$14=D5)*Sheet1!$E$4:$M$14)
I tried to adjust the ranges to your example, but change them if necessary.
I have developed this formula for you (001). Please take a look.
[E5] =SUMIFS(INDEX(Counts1,MATCH($D5,Stops1,0),0),Dates1,">=" & $E$2,Dates1,"<=" & $F$2)
The formula is designed for cell E5 of your fourth sheet. $D5, $E$2 and $F$2 are all on this sheet.
Counts1 is a named range on Sheet1, comprising all the passenger counts, starting from column E, up to the last day of the month and, vertically, from row 4 to as many rows as there are stations.
Stops1 is another named range on Sheet1 D4:[end of column].
Dates1 is a third named range on Sheet1, starting from E2:[end of row]. I would suggest you set up these named ranges to adjust dynamically to the actually used areas of the sheet.
Now, INDEX(Counts,MATCH($D5,Stops,0),0) defines all cells in the row of Counts where the Stop is equal to D5. Of course, this reference changes as you copy the formula down.
SUMIFS takes that range, extracts and sums up the numbers you are interested in.
Now, if you need to extract the same numbers by the same system from 3 different sheets you simply repeat the formula 3 times, concatenating the results with plus signs. That leaves you with the task to set up 9 ranges instead of only 3, each group of 3 on one of your source sheets. By the system I have implied above you would name them Count2, Count3 etc.
That leaves the question of your dates. They must be true dates. Text strings that look like dates won't do. (I guess you know that :-). In the test sheet I set up I entered =DATE(2020,3,1) in E2, [F2]=E2+1 and copied from F2 to the right.

Excel: Reference row indicated by cell

I have a sheet where each row is a month and columns are monthly numbers.
I made a separate sheet for each month where the numbers from each month can be pulled together and added up.
To do this, I've made a template for January and used references like: ='2019'!A8
I went through each month and changed the row number being referenced. ( ='2019'!A8 would change to ='2019'!A9 for the next month.)
Is it possible to pull the number for the reference from a different cell?
Could I have somehow referenced a cell which was just the number and used it for ='2019'!A#` Rather than change all my references by hand?
With a month indicator in each monthly sheet (say in D1 and 03 for March) then with all the monthly sheets grouped together my present understanding of what it is you want should be achieved with:
=INDIRECT("2019!A"&$D1+7)
(Don't forget to ungroup.)
I suppose your data look like:
Month Sales
January 500
February 1000
March 1500
... ...
Moreover somewhere on your monthly sheets I suppose the month will be written in a cell, say A1.
Then you could simply use the same VLOOKUP on all these sheets:
=VLOOKUP(A1;SALES_DATA;2;FALSE)
And if your monthly sheets name contain the month name in some way, you could even do something like:
=VLOOKUP(MID(CELL("filename";A1);FIND("]";CELL("filename";A1))+1;255);SALES_DATA;2;FALSE)
CELL("filename";A1) retrieves the whole sheet path like C:\Users\...\Desktop\[Sales.xlsm]March".

How to show a value in one cell when current week is in another cell in excel

My first time to this forum.
I am a free range poultry farmer and I am trying to make spreadsheets to monitor my flocks. I have made the flock specific input sheets and now working on getting information for all of them into one summary sheet.
My question is...
I have the age of the birds going down column A also I have dates by week end date going down Column B... I would like to know how to have it that in one summary cell when the current date falls into one of the weeks listed in Column B that the corresponding cell in Column A is shown in that Summary cell (showing the current age of the flock). I would like this obviously auto update when the date progresses into another week.
Can any one help??
Thanks
Put the current date in the header (=TODAY() function or variations).
Name the current date cell (e.g. Current_date)
If your data are in table format I recommend putting them in a Table, this will insert your formulae to any new row started. If you dislike them you can simply create filters.
Use the formula in say C5 "=B5=Current_date" This will give you a logical expression, TRUE or FALSE. You can filter for TRUE to see the flocks to sell/cut.

Resources