I have a spreadsheet tracking e-mails received from various colleges. Column A is the name of the college, B is the date and C-F are other information about the e-mail. What I'm trying to figure out is how can I make column 'G' the total count of e-mails received from that college (i.e. count the # of occurrences of 'Drexel' in column 'A' when a new e-mail is received from Drexel).
I'd also like to figure out how to get the last date (column 'B') based on all e-mails from Drexel.
So my sheet might have 2,500 rows, and I add 2,501 as 'Drexel' and column G would show 74 as the total number received and H would show 10/1/2014 as the last e-mail received before the current one.
The count of emails from a particular college can be done with a COUNTIF() formula:
=CountIf(A:A, A2)
Where A:A is the column with the colleges, and A2 is the college on this particular row that you are searching for. This will return the number of times that particular college is listed in the spreadsheet.
Your second requirement to get the Max Date is a bit more tricky, and I believe it will require an Array Formula. These are written the same as a regular formula, but instead of hitting ENTER when you are done writing it, you hit CTRL+SHIFT+ENTER (sometimes also called CSE formulas):
=MAX(IF($A$2:$A$2500=A2, $B$2:$B$2500))
Put that in H2 and hit CTRL+SHIFT+ENTER, it will then get some squiggly brackets around it to let you know it's CSE/ARray formula (don't put the squiggly brackets in yourself. Only CTRL+SHIFT+ENTER will work here).
This formula will search through A2:A2500 comparing it to the college in A2. If it finds a hit, it will grab the value from the respective row in column B. At the end it will be a big list of dates, 1 for each entry where the college matches. The MAX() formula will then aggregate that list into a single value that will be the max date in the list.
Copy both of those formulas down your rows and you should get what you want.
Related
I am working on a project where the aim is to categorize spending on bank statements based on their description. Bank statements are uploaded onto an excel spreadsheet each month, which then should look at the description of each spend and assign it to a category.
There are 75 spend categories listed out in a row, and under each category there is a list of text against which the description of the spends on the bank statement needs to be matched. If the description contains text from a cell, the function should say which category that particular cell is under.
$K$3:$CG$3 is where I have the names of the categories
$K$4:$CG$502 is where I have the list of all the identifying text for each of the categories
C is the column in which the descriptions from the bank statements are
I have come up with the below formula, which works fine however if I expand it to the full range of identifiers (replace $K$4:$CG$4with $K$4:$CG$502 in SEARCH function) it fails.
={INDEX($K$3:$CG$3,1,MATCH(TRUE,ISNUMBER(SEARCH($K$4:$CG$4,C6)),0))}
Any help is much appreciated.
The table is found on this link. Column D is the expected outcome once the SEARCH function is expanded as in Column E, which currently arrives to N/A. "nnnnn" values in columns K to CG are dummy values and will be populated by users.
Using INDEX(), AGGREGATE() & COLUMN() Function, you may try this formula,
• Formula in cell D3
=INDEX($K$3:$CG$3,
AGGREGATE(15,6,(COLUMN(Control!$K$4:$CG$502)-COLUMN(Control!$K$4)+1)/
(ISNUMBER(SEARCH(Control!$K$4:$CG$502,C3))),1))
And Fill Down! Workbook_Link
I thought this should be a common thing but my search has not returned anything meaningful. I'd prefer an Excel solution, rather than VBA.
I have a proposal sheet with details like number (col D), date etc and a column saying if the proposal got converted (to business).
On the invoice sheet, I have a list of invoices. The requirement is to always refer the proposal number against which this invoice is being raised. For removing human error, the applicable proposal numbers should be available as a drop down. Hence the drop down should only show the proposal numbers against which the invoice can be issued (proposal got converted to business).
This means that non-continuous cells (say, D3, D4, D6, and D10 - where proposal converted is 'yes') from the proposal sheet should be the values available in drop down of data validation in the invoice sheet. How do I achieve this?
Edit:
Adding an image that is representative of the 2 sheets.
My solution involves creating a list using the INDEX MATCH or INDEX SMALL method to pull multiple results from the data that can be used for the dropdown.
I added a couple of extra columns to count the number of times an invoice has been invoiced and then a further Yes/No to make the index formula easier to follow. You'll see that my example only has 2 values to select from as the others have been fully invoiced.
The scary formula in Q1
=IFERROR(INDEX($A$2:$H$1000,SMALL(IF(($H$2:$H$1000="Yes"),ROW($A$2:$H$1000)-1),ROW(1:1)),1),"")
This is an array formula so you must use SHIFTCTRLENTER instead of just ENTER in the formula bar. {} backets will be added if you do it right.
To break it down, INDEX($A$2:$H$1000 is selecting your proposal data and some more rows below (1000). SMALL(IF(($H$2:$H$1000="Yes") is looking at my extra Yes/No column for "Yes". ROW($A$2:$H$1000)-1) is returning the row number minus 1 to account for the fact that our range starts at A2. ROW(1:1) is saying that we want first match in the list and the ),1) returns the vlue in the first column of the range $A$2:$H$1000.
Because ROW(1:1) returns the first result, you will need to autofill down in order to pull more results. As you do this the formula will copy down as 1:1, 2:2, 3:3...ect. I filled down to row 50 to allow for a decent amount of results.
You could set your validation range to Q1:Q50 but then you would have lots of empty space in your dropdown so, have a look at cell R1.
="Q1:Q" & COUNTA(Q1:Q50)-COUNTBLANK(Q1:Q50)
This formula creates a range based on the results in column Q. You can use that value in the data validation range by entering.
=INDIRECT($R$1)
Thus creating the dynamic range that you require.
You don't have to use the extra columns that I added but the formulas are;
=COUNTIF(M2:M1000,A2) to count the number invoiced
=IF(AND(F2="Yes",G2<E2),"Yes","No") to check if it can still be invoiced.
if you do want to use them then I'd recommend formatting your data as a table so that the formulas are copied down automatically on new rows.
Also I'd advise putting the index list on a different sheet so that rows are not deletes etc.
My formula works, but only if its in the same page, and along the same rows
Formula:
=(INDEX($C$1:$D$4,SMALL(IF($C$1:$C$4=$F$2,ROW($C$1:$C$4)),COLUMNS(D1:D4)),2))
Note: Column G has the formula, what it does it look for value in F2 (which is 1.2) within the columns of C & D, and extracts the respective data in column D. So in this case, it would extract the data in column G.
Question: Now what do I do if I want this to occur from different sheets, or even different workbooks? I need to do this exact same thing, extract the data that is in column c and d (which is on a different workbook) to my workbook.
Every time I try, I get a value error.
Bonus: I'm also trying to get the date that is closest to today's date, I have this formula here:
=IF(COUNT(G2:G5)>0,INDEX(G2:G5,MATCH(MIN(ABS(G2:G5-$D10)),ABS(G2:G5-$D10),0)),"")
Where D10 is just equal to =TODAY() and this entire formula works by pressing ctrl+shift+enter
If you can also include this into the formula so that it just spits out the closest date in G2 rather than spit out all the dates. But it is not necessary, just helps a lot.
For your "Closest to today problem", I was trying to spread the difference of the date or a comparison of the date just like in your example. This is just not working out. I solved the problem by adding another column. I do not know if this is a valid option for you or not, but here is what I have. Assuming H is available or you can insert a new column H. use this dragged down for each row - in your exampl 2 thorugh 5.
=ABS(D$10-G2)
Then add this in H10 or wherever you see fit
=D10-(MIN(H2:H5))
Here is an excel-ish example
5/12/2014 =ABS(D$10-G2)
5/13/2015 =ABS(D$10-G3)
5/14/2014 =ABS(D$10-G4)
5/15/2014 =ABS(D$10-G5)
6/6/2016 =D10-(MIN(H2:H5))
I don't know if this is possible or not but here goes, my spreadsheet is as follows:
I have 4 columns- Date, Location, People Attended, % Attended
Going down I have lots of rows with data in. Eg, Date, where the cinic was, how many people turned up, and the percentage of people who booked in to who turned up.
I already have all of this information, but I have been asked if we could have a cell in Excel (can be a different sheet if needed) where we could put in "<65%" and all rows with more than 65% would be pulled through, leaving anything below out. This number could then be changed to any figure we wanted. Is it also possible to have anything above the number we put in, to add the previous column of attended to a total sum?
I hope this makes sense and is formatted correctly, thank you for any help you can provide.
Actually, you don't need any new work! Just use filters (Data tab --> filter).
You can then easily use number filters to get what you are looking for. You can use equality and inequalities (greater/smaller than).
ok so this is what works and how you should do it.
Highlight column a and add a column.
Add a sheet and name it sheet2 (this is only for now, after you're done you can rename it).
in sheet2 B1 enter a criteria E.G. >65 (this will be the cell you'll enter the criteria).
Back to sheet1. In A2 enter =IF(COUNTIFS(E2:E2,Sheet2!$B$1&"%")>=1,COUNTIFS($E$2:E2,Sheet2!$B$1&"%"),"")
Copy past to all the rows that have your data
Back to sheet2. in column a starting at row 2 enter numbers from 1 to 100 each number in a separate row, like this A2-1, A3-2 and so on (this will identify the number record the formula should return, if you asume you'll have more then 100 records matching your criteria, add more).
In sheet2 B2 enter =IFERROR(VLOOKUP($A2,Your table address as absolute ,2,FALSE),"")
In C2 enter =IFERROR(VLOOKUP($A2,Your table address as absolute,3,FALSE),"")
In D2 enter =IFERROR(VLOOKUP($A2,Your table address as absolute,4,FALSE),"")
In E2 enter =IFERROR(VLOOKUP($A2,Your table address as absolute,5,FALSE),"")
Now copy the formula down all the 100 rows
All the best, hope it works.
Feel free to ask
I run an open order report for a warehouse team every two days, and then go through the open orders; and email vendors to confirm their delivery date as pointed out by the report.
Naturally the reports are going to have some of the same information every other day, but there will be new orders, as well.
What I need to be able to do is figure out a way to tell the new spreadsheet to determine if any of the information in the new sheet was in the old sheet.
For example.
A, B, C, D, is Delivery Date, Part Number, Part Description, and Purchase Order Number - Respectively.
Information in spreadsheets in internal and confidential, otherwise I would post a photo of it, to help understand.
I want it to tell me if those items match between both spreadsheets, so that I don't suddenly end up asking twice about an order or have to go line by line to match up. Because that takes FOREVER.
Assuming the purchase orders are unique day to day, you can use the match function in a column on the new orders page to see if the same PO is on the old PO's tab. If you get a #N/A the values are unique. Otherwise, Match will return the row number of the matching value.
If you need to match on multiple values (e.g. Date, PO, Part#) then use the concatenate formula to create a multi-part key.
=Concatenate(Text(DateCell, "YYYYMMDD"),"_", PO,"_", Part#)
Then put the same formula on both sheets and do the match on your new key column.
If you want to test for equality across all items, you can do it easily with an array formula. Here is an example that compares 4 columns (similar to you) for exact matches. It multiples the combined result by ROW so that you can see where the last match occurs. It is the last one because MAX is used.
Hopefully you can see how this would be extended to your case. Note that this is an array formula (entered with CTRL+SHIFT+ENTER) in cell F2 copied down through the column.
Formula in cell F2
=MAX((A2=$H$2:$H$21)*(B2=$I$2:$I$21)*(C2=$J$2:$J$21)*(D2=$K$2:$K$21)*ROW($H$2:$H$21))
This formula works by building up a product of comparisons which is the same as an AND operation. This will be a 1 if the conditions are all true. That 1 is then multiplied by the ROW so that the match location is returned.
Picture with a couple matching rows colored and the ranges in color to see how the formula works.