I'm working on a workbook, containing 33 sheets, 31 sheets for daily tasks.
I wanted to show daily productivity in about 15 columns each day,I used Indirect with countifs but when I copy formula to next 15th cell it never goes to the right reference ..
=(COUNTIFS(INDIRECT("'"&SL$6&"'!J:J"),"B2",INDIRECT("'"&$SL6&"'!$L:$L"),$C7))
This formula counts In specific day (sheet) in J:J "Paid"("B2") while also it counts the person who sold items "Name"("C7")
this formula works perfect but...
in SL6 my sheet reference lays, for example, SL6:Sheet1 SM6:Sheet2
I want this formula in next 15th cell while it goes toTA6 which is Sheet16's reference, it should go to SM6, I know if I drag this formula into very next cell it will produce the right result but my formula will be staying every 15th cell till 31 sheets.. please I avoid VBA
Related
I have about 50 worksheets, each Worksheet contains specific cell (G11) in date format (dd-mmm-yy); other 5 worksheets used for other purpose.
What I need to do, first, to check cell G11 in the 50 worksheets match to current year and current month, then, count total number of G11 that meets current year and current month across all 50 worksheets. Finally, the counted number will be reflected in separate worksheet.
I had tried SUMPRODUCT or 3-D Reference, but I got return with #VALUE!. A2 is current mmm-yy; Sheet Name in 4 digit numbering:
=SUMPRODUCT(--(TEXT(INDIRECT("'"&Table[Sheet Name]&"'!$G$11"),"mmm-yy")=TEXT(A2,"mmm-yy")))
You could do:
=SUM(--(TEXT(N(INDIRECT("'"&Table[Sheet Name]&"'!$G$11")),"mmm-yy")=TEXT(A2,"mmm-yy")))
or
=SUM(--(TEXT(N(INDIRECT(ADDRESS(11,7,,,Table[Sheet Name]))),"mmm-yy")=TEXT(A2,"mmm-yy")))
If you have lower than Excel 2016, you have to do CTRL+SHIFT+ENTER to enter this formula.
Suppose the value of cell A1 is total sales $ at the Los Angeles location, year to date. The value is pulled from a pivot table on a different sheet.
The formula for A1 is:
=SUM(GETPIVOTDATA("Amount",'Transactions(Pivot)'!$A$75,"Location","Los Angeles","Months",{7,8,9,10,11,12}))
Currently, every month when I run this report I need to manually update the month arrays in the formulas; for example next month I will need to manually update {7,8,9,10,11,12} to {7,8,9,10,11,12,1}. There are many cells and this is a very tedious task.
My question is how can I automate the task of updating the month array in the GETPIVOTTABLE formula?
What I've attempted with no success: I set up a 2-column lookup table on a different sheet where column A is the current month and column B contains the month array value to be used in the GETPIVOTTABLE formula. For example:
7 {7}
8 {7,8}
9 {7,8,9}
etc...
Then I tried updating my GETPIVOTTABLE formula to use a VLOOKUP to get the month array:
=SUM(GETPIVOTDATA("Amount",'Transactions(Pivot)'!$A$75,"Location","Los Angeles","Months",VLOOKUP($B$2,$L$9:$M$20,2,FALSE))
But it didn't work - I get a #REF! error.
Thanks in advance for your help.
You can give a range instead of the vlookup and enter the numbers 7,8,9 . . . . in that range for example your formula
=SUM(GETPIVOTDATA("Amount",'Transactions(Pivot)'!$A$75,"Location","Los Angeles","Months",{7,8,9,10,11,12}))
will become
=SUM(GETPIVOTDATA("Amount",'Transactions(Pivot)'!$A$75,"Location","Los Angeles","Months",A1:A7))
and A1 to A7 contains the months.
after entering this formula press Ctrl+Shift+Enter
So at the top of my Excel sheet I have 2 cells, A2 and B2, where people can enter a starting and ending date.
On a seperate sheet I have an enormous list of starting and ending dates in columns A and B, and corresponding data for each of these 'events' in columns D through G. I need my function to copy all rows where the starting date falls between the two specified dates, and copy the data to the first sheet, in cells A4 - G4 through A100 - G100. (I just chose 100 as a large number, to make sure the area where the data gets placed is large enough)
I'm guessing this function I need includes the INDEX function, but I only know how to use it to look up one data cell at a time, not how to copy an entire range of cells.
Can anyone help?
No helper columns required.
Enter this formula into cell A4:
=IFERROR(INDEX(data!D$2:D$9999,SMALL(IF((data!$A$2:$A$9999>=$A$2)*(data!$A$2:$A$9999<=$B$2),ROW(data!$D$2:$D$9999),9E+99),ROW(1:1))-1),"")
This is an array formula and must be confirmed with Ctrl+Shift+Enter.
Now copy the formula to the range B4:D4.
Now copy the A4:D4 to the range A5:D100.
That's it.
Let's say Column C in the data sheet is blank, and free to add a formula.
Let's also assume that the data begins in row 2.
Then the following formula can be put in C2 & copied down:
=IF(AND(A2>=Sheet1!$A$2,B2<=Sheet1!$B$2),C1+1,C1)
Basically it is saying that if the beginning date of the current record is greater than or equal to the date the user is looking for, and the ending date is likewise within range, iterate the record, otherwise not.
At this point the user sheet can have a simple VlookUp as follows:
In D1: =VLOOKUP(ROW($A1),Sheet2!$C:$G,COLUMN(B$1),0)
Copy this across to G and down however many rows you like.
I have an Excel book with around 100 spreadsheets within the book. Each spreadsheet is an application of certain products. The very last spreadsheet is a total tally for the year for each product we use. The SUMIF formula I am using is:
=SUMIF('Jan 1:Dec 31'!B5:B14,"Name of product",'Jan 1:Dec 31'!D5:D14)
So when the Name of the product is used in B5:B14 in all spreadsheets from first (Jan 1) to last (Dec 31) I want to sum its value from the D5:D14 cells in all spreadsheets from first (Jan 1) to last (Dec 31).
The problem is that I just end up getting a #VALUE error. I have also tried inputting the formula by holding Ctrl+Shift. Nothing seems to work.
You could use the indirect formula and have Jan 1 in cell A1, and then in B1 have formula:
= sumif(indirect(A1&"!B5:B14"),"Name of product",indirect(A1&"!D5:D14"))
Then you'd put Jan 2 in cell B1 and copy the sumif formula down.
Note that this assumes structure is consistent on each tab and that number of rows is consistent on each tab as well (or you can make the bottom of the range an arbitrarily high number like row 50,000)
I am creating a spreadsheet with all my data on one sheet and metrics on the other.
On sheet 1 in cells A2:A50 I have the dates in this format (4/5/13). On sheet 2 in cell E5 I have April and I want it to total the number of PO's created in F5.
How can I do this?
I have tried using
=COUNTIF('2013'!$A$2:$A$50,'2013 Metrics'!E5).
I have a feeling that since my range is in 4/5/13 format and my criteria is April that won't work.
I was able to use this formula for total spend by month:
=SUM(IF(MONTH('2013'!$A$2:$A$19)=4,'2013'!$D$2:$D$19,0))
but not luck with how many PO's by month.
Use a pivot table. You can manually refresh a pivot table's data source by right-clicking on it and clicking refresh. Otherwise you can set up a worksheet_change macro - or just a refresh button. Pivot Table tutorial is here: http://chandoo.org/wp/2009/08/19/excel-pivot-tables-tutorial/
1) Create a Month column from your Date column (e.g. =TEXT(B2,"MMM") )
2) Create a Year column from your Date column (e.g. =TEXT(B2,"YYYY") )
3) Add a Count column, with "1" for each value
4) Create a Pivot table with the fields, Count, Month and Year
5) Drag the Year and Month fields into Row Labels. Ensure that Year is above month so your Pivot table first groups by year, then by month
6) Drag the Count field into Values to create a Count of Count
There are better tutorials I'm sure just google/bing "pivot table tutorial".
For anyone finding this post through Google (as I did) here's the correct formula for cell F5 in the above example:
=SUMPRODUCT((MONTH(Sheet1!$A$1:$A$50)=MONTH(DATEVALUE(E5&" 1")))*(Sheet1!$A$1:$A$50<>""))
Formula assumes a list of dates in Sheet1!A1:A50 and a month name or abbr ("April" or "Apr") in cell E5.
Make column B in sheet1 the dates but where the day of the month is always the first day of the month, e.g. in B2 put =DATE(YEAR(A2),MONTH(A2),1). Then make E5 on sheet 2 contain the first date of the month you need, e.g. Date(2013,4,1). After that, putting in F5 COUNTIF(Sheet1!B2:B50, E5) will give you the count for the month specified in E5.
I would add another column on the data sheet with equation =month(A2), then run the countif on that column... If you still wanted to use text month('APRIL'), you would need a lookup table to reference the name to the month number. Otherwise, just use 4 instead of April on your metric sheet.
use count instead of sum in your original formula u will get your result
Original One
=SUM(IF(MONTH('2013'!$A$2:$A$19)=4,'2013'!$D$2:$D$19,0))
Modified One
=COUNT(IF(MONTH('2013'!$A$2:$A$19)=4,'2013'!$D$2:$D$19,0))
AND USE ctrl+shift+enter TO EXECUTE
Recommend you use FREQUENCY rather than using COUNTIF.
In your front sheet; enter 01/04/2014 into E5, 01/05/2014 into E6 etc.
Select the range of adjacent cells you want to populate. Enter:
=FREQUENCY(2013!!$A$2:$A$50,'2013 Metrics'!E5:EN)
(where N is the final row reference in your range)
Hit Ctrl + Shift + Enter
Sooooo, I had this same question. here's my answer: COUNTIFS(sheet1!$A:$A,">="&D1,sheet1!$A:$A,"<="&D2)
you don't need to specify A2:A50, unless there are dates beyond row 50 that you wish to exclude. this is cleaner in the sense that you don't have to go back and adjust the rows as more PO data comes in on sheet1.
also, the reference to D1 and D2 are start and end dates (respectively) for each month. On sheet2, you could have a hidden column that translates April to 4/1/2014, May into 5/1/2014, etc. THen, D1 would reference the cell that contains 4/1/2014, and D2 would reference the cell that contains 5/1/2014.
if you want to sum, it works the same way, except that the first argument is the sum array (column or row) and then the rest of the ranges/arrays and arguments are the same as the countifs formula.
btw-this works in excel AND google sheets. cheers