duplicate multiple numbers in excel - excel

I am trying to create a database in excel. I have a chronological list of 365 dates and I want to be able to fill in 100 cells for each date in a single row.
DATE
1/1/2018 (listed 100 times)
1/2/2018 (listed 100 times)
1/3/2018 (listed 100 times)
(1,36500)

In A1:
=DATE(2018,1,1) + FLOOR((ROW()-1)/100,1)
fill down to required point

You just highlight the first cell in the row, Cut and then select the next 100 cells and paste it in.

Related

How to keep excel formula consistent with inserting new columns

In my sheet, my top row is a bunch of dates and I have columns separating the weeks.
| 1.1 | 1.5 | 1.12 | 1.29 |JANUARY TOTAL| 2.3 | 2.15 | FEBRUARY TOTAL|
----------------------------------------------------------------------
Below each date is the number of hours worked on a project, and in each "MONTH TOTAL" column is a sum of the time worked on each project per month.
When I created this spreadsheet, I put in a filler of 2 blank spaces, but since I can't predict when I'll be working on each project, I have to rely on inserting new columns if I decide to work on something on a day that isn't preset into the sheet.
The problem is that my formulas don't extend all the way to the MONTH TOTAL columns when I insert new columns. For instance, when I create my spreadsheet, my formula for one of the totals in the MONTH TOTAL column would be "=SUM(B2:C2)" but when I insert two more dates I need the formula to be "=SUM(B2:E2)".
Is there a way to encapsulate inserted cells into a formula so that it sums between a bound of two columns and any new inserted cells?
You can use the INDIRECT function coupled with ADDRESS, ROW, and COLUMN.
In your stated example, let's assume your "MONTH TOTAL" formula is in D2 and currently contains =SUM(B2:C2). You will want to update the formula to:
=SUM(B2:INDIRECT(ADDRESS(ROW(),COLUMN()-1)))
Whenever you insert a new column, it will still SUM by referencing the values in the preceding columns.

Excel (Google Spreadsheet): get values between two dates

I have seen lots of questions regarding this, on here and on other websites. However even with all that I have read I cannot accomplish what I want.
I have an Excel document with in cell A2 a starting date and in B2 an end date.
In A5:C11 I have a table with data. In cells A5:A11 I have dates, in B5:C11 I have the data. Now I want to display the data from B and C if they fall between the dates given in cells A2 and B2. I want to do so via a formula. I have tried many formulas with index, match, vlookup, small , sumproduct, if(s) and so on. Maybe any of you can help me?
Start date End date
29-12-2017 29-12-2017
Date Users Pageviews
04-01-2018 350 400
03-01-2018 300 350
02-01-2018 250 300
01-01-2018 200 250
31-12-2017 150 200
30-12-2017 100 150
29-12-2017 50 100
In this case I want the output to be, preferably in 3 cells:
29-12-2017 50 100
Make another table in F5:G11 with this formula in F5 and copy over:
=IF(AND($A5>=$A$2,$A5<=$B$2),B5,"")
Then in H5:I11 use this formula to remove the blank rows (adapted from here):
=IFERROR(INDEX(F$5:F$11,AGGREGATE(15,6,(ROW(F$5:F$11)-ROW(F$5)+1)/(F$5:F$11<>""),ROWS(G$5:G5))),"")
The result:
Parameter to change in green, your data in blue, intermediate formulae in grey (hide these columns?) and the final result in orange.
To get the list of dates use:
=IFERROR(AGGREGATE(15,6,$A$5:$A$11/(($A$5:$A$11>=$A$2)*($A$5:$A$11<=$B$2)),ROW(1:1)),"")
Then once we have the dates it is a simple Vlookup for the other two:
=IF(F5<>"",VLOOKUP($F5,$A$4:$C$11,COLUMN(B:B),FALSE),"")
Put the First in F5 and copy down.
Put the Second in G5 and copy over one column and down.

How to do a running count of dates within a date range in excel?

I am trying to build a formula in excel, that will do a running count of dates within a specified date range for an item. For example: Item A has a Start Date of 7/15 and an End Date of 7/18. I need a formula that will "tally" or add "1" to a running count for 7/15, 7/16, 7/17, 7/18 in another column that has a comprehensive list of dates. How can I do this?
EXAMPLE ATTACHED AS LINK
Well... Some examples would be helpful, but it sounds like you're looking for countifs.
If we create two excel tables, one called Items with Start and End dates:
Title Start End
ItemA 7/15/2017 7/18/2017
ItemB 7/16/2017 7/20/2017
And one called Dates which counts the Items
Date Count
7/15/2017 1
7/16/2017 2
7/17/2017 2
7/18/2017 2
7/19/2017 1
7/20/2017 1
Then our formula in the Count column of Dates would be
=COUNTIFS(Items[Start],"<="&[#Date],Items[End],">="&[#Date])
In plain english, this is saying "Count all items in Table Items where the value in the Start column is less than or equal to the value in my Date column and the End column is greater than or equal to the value in my Date column. Note that these formulas are entirely in Excel Table format, which makes for more readable formulas. If we want A1 notation, we will assume that the Items table starts at A1, which would result in the following formula:
=COUNTIFS($B$2:$B$3,"<="&$E2,$C$2:$C$3,">="&$E2)

Excel Formula: Outputting multiple column headers based on row data?

I have a table in a monthly calendar format (Dates as column headers) and the data in the rows are marked with the cost for that day for that room eg:
1 2 3 4 5 ....
Room 1 100 100
Room 2 100
Room 3 100 100 100
What I want to do is for each room, to know the days that the expense of 100 occurs, eg for Room 1, the expense occurs on day and day 3.
I have tried a formula INDEX($G$3:$AK$3,1, MATCH(100,$G4:$AK4,0)) but it will only show the first column that it appears.
How can I do it so it shows multiple columns?
Your help is much appreciated.
Assuming you have your worksheet setup as below:
Add this formula in cell AI3 and confirm with Ctrl+Shift+Enter and drag down.
=IFERROR(INDEX($A$1:$AF$1,1,SMALL(IF(($A$2:$A$100=$AI$1)*($B$2:$AF$100=$AI$2),COLUMN($B$1:$AF$1)),ROW()-ROW($AI$2))),"")

Sum values in a column based on date

I have written this function that will give me a monthly sum for two columns: one has the date of each order, one has the cost of each order.
=SUMIF($C$1:$C$1000,">="&DATE(2010,6,1),$D$1:$D$1000)-SUMIF($C$1:$C$1000,">="&DATE(2010,7,1),$D$1:$D$1000)
Using data like this:
8/16/10 17:00 7.99
8/16/10 14:25 7.99
8/15/10 22:42 7.99
I end up with a table like this:
May 998
June 968.28
July 1239.76
August 514.96
However, now I would like to do daily sums and using my way I have to hand edit each row.
How can I do this better in Excel?
Use a column to let each date be shown as month number; another column for day number:
A B C D
----- ----- ----------- --------
1 8 6 8/6/2010 12.70
2 8 7 8/7/2010 10.50
3 8 7 8/7/2010 7.10
4 8 9 8/9/2010 10.50
5 8 10 8/10/2010 15.00
The formula for A1 is =Month(C1)
The formula for B1 is =Day(C1)
For Month sums, put the month number next to each month:
E F G
----- ----- -------------
1 7 July $1,000,010
2 8 Aug $1,200,300
The formula for G1 is =SumIf($A$1:$A$100, E1, $D$1:$D$100). This is a portable formula; just copy it down.
Total for the day will be be a bit more complicated, but you can probably see how to do it.
Use pivot tables, it will definitely save you time. If you are using excel 2007+ use tables (structured references) to keep your table dynamic. However if you insist on using functions, go with Smandoli's suggestion. Again, if you are on 2007+ use SUMIFS, it's faster compared to SUMIF.
Following up on Niketya's answer, there's a good explanation of Pivot Tables here:
http://peltiertech.com/WordPress/grouping-by-date-in-a-pivot-table/
For Excel 2007 you'd create the Pivot Table, make your Date column a Row Label, your Amount column a value. You'd then right click on one of the row labels (ie a date), right click and select Group. You'd then get the option to group by day, month, etc.
Personally that's the way I'd go.
If you prefer formulae, Smandoli's answer would get you most of the way there. To be able to use Sumif by day, you'd add a column with a formula like:
=DATE(YEAR(C1), MONTH(C1), DAY(C1))
where column C contains your datetimes.
You can then use this in your sumif.
Add a column to your existing data to get rid of the hour:minute:second time stamp on each row:
=DATE(YEAR(A1), MONTH(A1), DAY(A1))
Extend this down the length of your data. Even easier: quit collecting the hh:mm:ss data if you don't need it. Assuming your date/time was in column A, and your value was in column B, you'd put the above formula in column C, and auto-extend it for all your data.
Now, in another column (let's say E), create a series of dates corresponding to each day of the specific month you're interested in. Just type the first date, (for example, 10/7/2016 in E1), and auto-extend. Then, in the cell next to the first date, F1, enter:
=SUMIF(C:C, E1, B:B )
autoextend the formula to cover every date in the month, and you're done. Begin at 1/1/2016, and auto-extend for the whole year if you like.
If the second row has the same pattern as the first row, you just need edit first row manually, then you position your mouse pointer to the bottom-right corner, in the mean time, press ctrl key to drag the cell down. the pattern should be copied automatically.

Resources