As seen below, I have an excel file where collections from debtors is recorded.
Column A is the staff code who made the collection..
Column B is the date of collection
Rest is self explanatory
Out of this table, on a different sheet, I need to extract data from this table and populate a new table with the filtered data. E.g., On the second sheet, I need a table to show collections from only P102, of which I have managed to do with the below array formula:
{=INDEX(Sheet2!$A:$A,SMALL(IF(Sheet2!$A:$A="P102",ROW(INDIRECT("1:"&COUNTA(Sheet2!A:A)))),ROWS(Sheet2!$A$2:$A2)))}
Of course this code outputs only the Personnel code but I've ammended this to show for other columns too..
The thing I can't manage to do is, I also need to apply a second filter with the date.. Eg. Only those records from P101 and only in February..
I would really appreciate any feedback on this...
P.S. I do not wish to use Macros and No, I can't make a pivot table...
Regards,
Kemal
Personally I'd approach it using an array formula with logical conditional multipliers. Very similar to SUMIFS.
Here's the output I understand you require:
Here'e the array function (shift + ctrl + enter) I've used placed in cells G2:G5:
={SUM(IF(Table1[Personel]=E2,1,0)*IF("2014"&VLOOKUP(F2,{"Jan",1;"Feb",2;"Mar",3;"Apr",4;"May",5;"Jun",6;"Jul",7;"Aug",8;"Sep",9;"Oct",10;"Nov",11;"Dec",12},2,0)=TEXT(Table1[Date],"yyyym"),1,0)*Table1[Cash])}
Please indicate if there is anything further outstanding.
Kind regards,
James
Related
I'm trying to fill in a table using data from another table. I've researched the VLOOKUP function, and either I don't fully understand it, or it isn't the right tool.
For example, let's say I have a column of data that is of the format: (p53, chk2, stra8-cre)
From this column, I want to extract any row (the entire row) that has 'chk2' in it. What tool can I use for this?
Thanks
From what I'm understanding, you're trying to have a formula in one cell that sets the content of all cells in its row. As far as I know, you can't do that without some sort of macro.
My suggestion would be to have a similar formula in each of the rows you want to set.
EDIT:
Use SEARCH to help with this problem. Look here on how to use it for this case.
Ex:
layout in CSV format:
p53chk2,a2,a3
chk2,b2,b3
stra8-cre,c3,c4
formula:
=IF(ISNUMBER(SEARCH("chk2",$A1)),B1,"")
Copy this formula across all cells in the row, and the contentshould be applied the subsequent cells.
Hope this helps, let me know if this isn't exactly what you were looking for.
Apology if this question has been answered before. In the Summary column I would like to calculate total values for each UserID, excluding Fee which is always 19. As you see there are duplicate UserID's.
I was thinking of using SUMIF'S something like...
=SUMIF(Value, Name,<>"Fee,<>
then I couldn't get it right.
So for example UserID 4836344 total value would be 97.83.
What formula should be used to solve this problem.
Thanks in advance if anyone can help me.
P.S - Let me know if you cannot see the image below.
I would just add another column EffectiveValue that would contain effective value that needs to be added to the total sum. Formula for that column would be something like '=If([Name]="Fee";0;[Value])'.
Then I would sort table by UserId column.
After that I would use Data -> Subtotals feature to produce total sum per user. In wizard you would specify that on every change in UserId calculate sum of EffectiveValue
Sorry if there are syntax mistakes & formatting, but I am writing from mobile phone.
You got your SUMIFS formula almost right. You just need to include the <> within the quotation marks like so:
=SUMIFS($E$2:$E$19,$A$2:$A$19,A2,$D$2:$D$19,"<>Fee")
The above assumes that your sample table starts at A1 with UserID and continues through column E with the values. The above formula would go into cell F2 as the first summary and should be copied down. Keep in mind to adjust the range to include more rows (here only through row 19).
If you have the above sample as a table then you can also use the following formula for F2 and Excel will automatically copy it down:
=SUMIFS([value],[userid],A2,[name],"<>Fee")
To convert your table to an "Excel recognized table" select the entire table and press Ctrl + T as described in more detail on Microsoft's website.
For more information on "Tables in Excel" you might want to read the following articles:
Overview of Excel tables
Use Excel tables to manage information
My original data looks like this:
I want my data to be transformed into:
Is there any way that we can do this without using pivot/subtotals. The reason why I am against pivot/subtotals is because i want to merge this data with some other data and do some calculations. VBA holds good too.
Any ideas please? I do not want the entire solution here, just suggest me some idea to proceed. I did a bit of research and all those were just the pointers to Pivot/Subtotals.
What have you tried? Please share your code/research.
For the "Total Effort" try:
=SUM(IF(B$2:B$9=G2;D$2:D$9))
And hit CTRL+SHIFT+ENTER when editing the cell value. Then drag it down.
Where "G2" is the "Name" value. "B2:B9" is the "Name" column and "D2:D9" is the "Total Effort" column.
Other columns:
To get the other columns you need to get the unique values. Try this for the ID column (assuming you want the unique IDs in Column F):
=INDEX($A$2:$A$9;MATCH(0;INDEX(COUNTIF($F$1:F1;$A$2:$A$9);0;0);0))
And hit CTRL+SHIFT+ENTER when editing the cell value. Then drag it down until you get #N/A values.
Where "A2:A9" is the "ID" column. "F1:F1" is the new column with the unique "ID".
I do this all the time for sundy data munging, you can connect to the workbook using ADO and run a SQL groupby statement on the sheet.
If you don't want to use VBA then you can do the same thing with microsoft query, though its a bit clunky using Data> from other sources > From microsoft query (data source = excel file).
For an easier query builder you could just import your table into Access and run a groupby query there, then copy paste it back.
i have a little problem with final formulas in one of my column. How to start. maybe i will explain what i have a then what i want.
i have an excel worksheet with 3 sheets. i want to record goods and what are these goods made of. first is sheet called Goods where is possible to put number of goods i want to make. In this case i want to make 1x sandwich1 and at the same time 3x sandwich2. i dont want make sandwich3 this time.
Second sheet is Matrix sheet where I record every good and what it is made of. This sheet is basic sheet and all other sheets take list of goods (resp. ingredients) from this sheet. Simply when i want to make sandwich1 i look at matrix and know that i need 1x1pc of egg + 1x5g of cheese. And for 3x sandwiche2 i need 3x10g of sausages.
Final sheet is called Ingredients. It is a list of used ingredients from Matrix sheet (exactly same order) to make these sandwiches. I want to fill formulas into column B which would go through one ingredient ofter ingredient and count needed amount of it. So it would look into matrix in the same row and where there is some number it would multiply with number of items from Goods sheet. The list of goods is also in the same order as in the matrix sheet.
I hope you understand now what i want and will try to help me. I think there will be SUMPRODUCT, SUMIF and maybe INDERECT functions but i am not that skilled in excel
thanks for any suggestions
You can use MMULT function here - it's an "array formula" which you need to enter in a range. You can do that like this:
In Ingredients worksheet enter this formula in B2
=MMULT(Matrix!C2:E4+0;Goods!B2:B4+0)
[I'm assuming you have a European version of Excel where ; is used to separate arguments]
Now select the whole range B2:B4, press F2 key to select formula and hold down CTRL and SHIFT keys and press ENTER. This "array enters" the formula in the range and you should now see curly braces like { and } around the formula and also the correct results.
You cannot change part of that array now, only the whole thing
Note that I'm assuming that the contents of Goods!A2:A4 will be the same as Matrix!C1:E1 and in the same order. You can extend the ranges to be as large as you like as long as that principle still holds
I suspect that this is an issue of "when all you have is a hammer, every problem is a nail". For reasons known only to you you are using a spreadsheet to solve a problem that databases were made to do. Any solution to this problem in a spreadsheet will be entirely dependent on the integrity of your data - add another column or get things out of order and it will fail.
That said, what you have in your link is effectively a pivot table and what you need is the unpivoted version of this - the instructions for getting this are here.
When you have that, you can use the various database functions in excel to get your answer.
please can you tell me how can it be done as i know there are probably several ways of doing it
i have table
so if i want to reduce the qty of a specific product and its type by typing the product and type in another table along with the qty to be subtracted how do i go about it
so far i have used the following function:
=INDEX(A2:J49,MATCH(1,(A2:A40=L12)*(B2:B49=M12),0),5)
but this gives me the value of the qty column based on the product and its type
any help will be highly appreciated
thanks
With out using a macro you cannot change the value of a cell if that cell doesnt have a formula in it
You can create another table, which will show the updated result for product and type, here we will be using the first table as an starting point, adding or subtracting some qtty from the second table, and the result will be shown in thrid table. Otherwise you will be needing VBA code for this task.