I have a formula that basically compares between each columns of two different sheets and outputs the different on another sheet
Something like :
=IF(Jan!A1<>Feb!A1,"JanSales: "&Jan!A1&char(10)&"FebSales: "&Feb!A1,"")
Basically this gives the exact differences between the Jan and Feb data which I can drag the formula cell to give me results for the desired number of rows. However the problem is I have nearly 0.5 million rows in the sheet. Is there a better way other than dragging the cursor till 0.5 Million rows
Thanks
Related
I have a thousands of rows of here data in a spreadsheet (excel 1 image) that I need to create a table with the data populated across the headers below.
If you don't want to use a VBA or spend time with other custom queries, you can do something like this (not, need to create helper column):
Create a helper column that does a count if:
Using this formula:
=IF(B2="Facility ID:", COUNTIFS($B$1:B2,"Facility ID:"),"")
Then structure your data table like this:
And you can use this formula (starting in cell I7):
=INDEX($A:$E,MATCH($H7,$A:$A,0)+I$4,I$5)
Then all you need to do is drag down the rows and increment the counts and it should work provided that the spacings always stay the same and the locations of the fields also stay the same
This solution requires a version of Excel that supports XLOOKUP and Dynamic Arrays.
I would add two columns. One to count records and one to count the line number of the record like so.
E2 is =IF(A2="Facility ID:",MAX(E1:$E$1)+1,E1) and F2 is =IF(E2=E1,F1+1,1). Those formulas are dragged all the way down with the exception of the last row. That is a 6 manually entered because the typical 4th and 5th line are missing from that record.
Then sheet2 looks like this.
A2 counts the number of total rows of data in sheet1. =COUNT(Sheet1!E:E)
Rows 3 and 4 show the positions of each field within the record.
A6 starts a list from 1 to number of records. =SEQUENCE(MAX(OFFSET(Sheet1!E2,0,0,B1))) This uses the dynamic array functionality to spill into multiple cells.
The formula in B6 spills into multiple cells as well.
=XLOOKUP($A6#&B$3,OFFSET(Sheet1!$E$2,0,0,$B$1)&OFFSET(Sheet1!$F$2,0,0,$B$1),OFFSET(Sheet1!$A$2,0,B$4,$B$1),"")
I used OFFSET in the formulas so they can update if additional data is entered.
Finally, copy the formula in B6 to the other columns.
I have two sheets "Aug" & "Dashboard."
The "Aug" sheet it is always growing and it has multiple columns, but the important ones are "Week" (Week is in B3) and "Group" (in C3).
I am able to do a formula that will count if any row in the "Group" column has the word "Harvest". =COUNTIF(Aug!C3:Aug!C1301,"Harvest")
But, I would also like to be able to count the number of times Harvest shows up depending on the week and to put that information in a certain cell in the "Dashboard" Sheet.
Here is what the "Aug" sheet could look like
Week Group
31 harvest
31 harvest
31 rqst
31 harvest
32 harvest
32 harvest
The "Dashboard" sheet has a cell (A35) where you type in the week you want to look at.
For example if I want the sheet to count how many times the word harvest shows up in week 31 then I would type 31 and I should expect the number 3 to turn up.
I tried using a countif formula and an if formula, but that didn't work for me. Here is the formula that I tried using.
=IF(Dashboard!A36=Aug!B4:AugB1301, COUNTIF(Aug!C4:Aug!C1302,"Harvest"))
I get a #name! error.
I then tried focusing on just one cell to see but I can't even get that to pull correctly.
=IF(Dashboard!A36=Aug!B1302, COUNTIF(Aug!C4:Aug!C1302,"Harvest"))
So What I understand from my formula is that If the number in cell A35 matches a the cell in the Aug sheet b1302, the it should count the entire column C and count how many times the word harvest comes up.
I keep getting a False statement.
I can make the countif statement work on it's own. I can use the count if statement to give me a total of "harvest" in the entire column.
I want it to count per the week i tell it to.
Snippet of my Dashboard sheet
Example of my Aug Sheet where I want to focus on just one cell
And, if there is a VBA code that does this then it will be so much better because I will be able to have the formulas hidden.
Thank you
COUNTIFS() with an S allows multiple criteria:
=COUNTIFS(Aug!C3:Aug!C1301,"Harvest",Aug!B3:Aug!B1301,Dashboard!A36)
I have an excel dataset with a rows and 5 columns per row.
I need to transpose so that all data is in rows with just two columns:
each row must have Column 1 from the dataset in its column 1 and each of the columns 2-5 in the dataset as its column 2, when those are exhausted row 2 of the dataset is processed in the same way. This would result in each row in the dataset creating 4 rows in the transposed set.
To better explain I have added in some screenshots of what I mean.
unfortunately i cannot access VBA or macros on our machines so it needs to be a formula.
Sorry posted before I'd completed the question:
I have tried using a variation of =row() and =column() to try to count columns and then move to the next row when column number is more than 5 but I'm struggling to work out the logic that would work.
I've also toyed with =index with the entire dataset as an array and use some calculations to give the function the pointers to the row and column to next display.
But as an array its pretty slow when dealing with 10,000 records (and I still haven't worked out what logic I would use).
You are on the right track with Index and Row
In you unpivot sheet, use
A1
=INDEX(Source!$A:$A,INT((ROW()-1)/4)+1)
B1
=INDEX(Source!$B:$F,INT(ROW()-1)/4+1,MOD(ROW()-1,4)+1)
I have a data of 1000 rows in Excel, and I wish to calculate the variance of every 10 data, say =var.s(A1:A10), =var.s(A11:A20), .....
I did the first two manually and tried to drag the formulas down, but instead of having =var.s(A21:A30), =var.s(A31:A40) I had =var.s(A3:A12), =var.s(A13:A22).
Could anyone please suggest how I can get my desired results?
If your values are in ColA you can use a formula like the one shown below: for each row you drag it down it will offset the range fed to VAR.S by 10 rows.
I have an employee data base that contains names and 8 movement types (Ex. Recruitment, Resignation....etc). Also I have starting head counts.
What I need to do is calculating movement counts and head counts based on the month for 12 months. Currently i am using SUMIF formula to calculate all these and the thing is excel will be very slow with all formulas. Appreciate if anyone can help me on this. See the image below for sample of the formula and I need to insert this formula in more than 600 lines.
A pivot table would be a good way to go, but by the look of your criteria you'll need to create 'helper columns' to ensure your data is ready for aggregation in a Pivot table.
For instance in your master data tab, add a new column called 'MatchesCriteria' or words to that effect, and build a formula in that column that checks for all of the criteria that you want to have the report based on, and returns a 1 or a 0, e.g.
=IF( (IF(C2="Recruitment",1,0)+IF(D2="Secondment In",1,0)) > 0 , 1 , 0)
Then run a pivot table including the 'Plant' column in your Rows, the month column in your columns and the 'MatchesCriteria' in your data values, and switch the calculation type to 'SUM' rather than 'COUNT'.
This will do the trick and will refresh in a flash compared to evaluating all of those countif statements.