working with multiline cells without spliting them in Excel - excel

I have a table with hundreds of rows in a very heavy excel workbook, I give a simplified like so:
And another table with combined text:
Is there a way I could have a formula that would allow me to check in the 1st table the individual values of each multiline cell and then add them in the total, to obtain something like this:
The point here being that the file might change in the future, rows could be added or deleted and so on, so I would like to be able to obtain the totals without splitting the multiline cells.
I've tried countIf but I don't think that's the proper way to go. Any help would be appreciated.

Multiple options really. You could try:
Formula in B10:
=SUMPRODUCT(ISNUMBER(FIND(A$2:A$7,A10))*B$2:B$7)
Or, a bit more in line of checking each individual value inside your combination:
=SUMPRODUCT(VLOOKUP(FILTERXML("<t><s>"&SUBSTITUTE(A10,CHAR(10),"</s><s>")&"</s></t>","//s"),A$2:B$7,2,0))

Related

VLOOKUP filling in blank spaces

So honestly I feel really dumb here. I have a very large file that has a lot of blank values where there should have populated a name, and I wanted to use a formula to fill those in. The data that I have is what appears in Columns A and B: A bunch of customer names and corresponding transaction codes (that repeat several times over), but blank spaces in a lot of places where the customer name should be. My attempt to fix this was to try filtering the data to get rid of the blank spaces, and use a VLOOKUP formula off that new table. Any ideas on what I'm doing wrong here? I don't care if it's a VLOOKUP, I just know there's an easier way to fix this that I'm not seeing, but none of the posts I've found fixed my issue...Thanks for any help you can give. Snapshot of Excel Table
Vlookup only performs matching left-to-right: the matching column has to be the first column of the range(D2:D13).
If you have Excel 365, you can use Xlookup:
=XLOOKUP(B7,E$2:E$13,D$2:D$13,,0)
or if not, you can use Index/Match:
=INDEX(D$2:D$13,MATCH(B8,E$2:E$13,0))
It might be more convenient to test for blank cells in column A and fill them in using a separate column if so, eg in C2:
=IF(A2="",XLOOKUP(B2,E$2:E$13,D$2:D$13,,0),A2)

Data from Rows to a Single Column? (Cell Formula)

Is there a way to convert data from a row-array over to a single column, without breaks, using cell formulas?
Example Table:
The following explanation does what you are looking for, EXCEPT it also includes the empty (unanswered) questions. I can't think of a way to do also remove the empty ones.
source: https://www.extendoffice.com/documents/excel/2775-excel-convert-matrix-to-single-column.html
Another way would be to use VBA

Excel - issue with VLOOKUP formula - it doesn't pick dates

I need help with the below formula. I already tried to find a solution for this problem but no success.
If account number exists in column A in the 'Returns' tab and also in column A in the 'July Sales' tab, then I need to get date from the column B in 'Returns' tab.
I manually checked a few accounts on both spreadsheet and find some duplicates.
My formula is as follows:
=VLOOKUP(Returns!A:B,A:B,2,0)
Screenshots:
I tried to change format to text/general, text to columns and trim function but it's still not working.
Also, as I have over 200k rows in each table, can I use any different formula instead to speed this up?
Finally, is there any way to pick dates only if these are within 30 days
Thanks in advance.
You're using Returns!A:B as your lookup value, which doesn't make sense. Instead, try the following:
=VLOOKUP([#Account], tblReturns[[Account]:[Submit_Date]],2,FALSE)
where tblReturns is the name of the table on your Returns worksheet.
I've made the assumption that you're working with tables, since the data in your screenshots is formatted like the default table. If they're just normal ranges, the equivalent is
=VLOOKUP($A2,Returns!$A:$B,2,FALSE)
=IF(COUNTIF(RETURNS!A:A,A2)>0,B2,"NO RETURN INFO")
Not sure what you want done when the account is not found on the RETURNS worksheet. Change "NO RETURN INFO" to what ever text you want including "" for a blank. Make sure you apply the same format for cells in column F as you do in column B. Copy the above formula down as required.
try the below, which will return blanks for non-matches as opposed to errors;
=IFERROR(VLOOKUP($A2,Returns!$A:$B,2,FALSE),"")
I highly recommend an INDEX/MATCH combination over a VLOOKUP. It is MUCH faster, particularly if you are working with a large number of rows. It may even be faster than the COUNTIF solution suggested by #ForwardEd.
=IFERROR(INDEX(Returns!$B:$B,MATCH($A2,Returns!$A:$A,0)),"")

Excel Range inside IF formula - DE-DUPE

I have a very long list in excel. I'm trying to de-dupe without re-organising the list. I have done a lot of de-duping before and I would normally just organise the list and use the below simple IF statement:
=IF(A2=A1,"DUPLICATE FOUND","no dupe")
However I have a list with 15,000 rows of data and I need to see if any two rows contain the same data:
=(IF(A2=(A1:A15000),"DUPLICATE FOUND","no dupe"))
So my question is what the heeby jeebies is wrong with my second statement?
Thanks
COUNTIF can be used with unsorted lists
=IF(COUNTIF($A$1:$A$15000,A1)>1,"DUPLICATE FOUND","no dupe")
Also, if you don't want to use a helper column, then excel has a 'Highlight Duplicates' conditional formatting:
Use Advanced filter with copy to a new location and Unique values only - or Remove Duplicates.
A2=(A1:A15000) will only test for A2=A1.

Using a Variable in Excel for COUNTIF

First time question and I hope it's easier than I'm making this.
Can I use a variable inside a COUNTIF formula?
Currently my formula is:
=COUNTIF($C$2:$C$415,R6)
I would like to have $415 as my variable. I have tried something along the lines of:
D1=415=COUNTIF($C$2:$C$(D1),R6) ..
but obviously get a error.
The reason I need this is column C will constantly be incrementing as I add more rows.
Instead of going into each of my formulas and updated 415 to 416, 417 etc, I would like to just define a Cell that can be my variable, or total rows.
Currently Column C can have blank cells, so I can't have a macro that finds the next empty cell.. but I do however have Column A with a constant populated cell and stops at the last ticket. However Column A is unrelated to the COUNTIF.
UPDATE 1
I'd also like to mention that I'd be using this variable in many formulas in the spreadsheet. Not only COUNTIF's. Also, the COUNTIF contains text.
UPDATE 2
Actually, I figured it out! I am using this formula instead:
=COUNTIF(INDIRECT("C"&D1&":A"&D2),R6)
I'm putting D1=2 and D2=415 and will just update cell D2 with how many rows I have.
I guess I just needed to ask the question thoroughly to fully understand what I wanted!
Thank you in advance for all help, tips and suggestions.
Would "=COUNTIF($C:$C,R6)" do the trick? This will apply COUNTIF to the whole of column C. It's an easy solution, but probably not the most efficient.
I prefer tables for storing data; as new data is added, the table automatically expands and the columns are already labeled (much like Named Ranges). Then you can have =COUNTIF(Table1[Column1],"Criteria"), which will encompass any new rows added to the table automatically. Especially helpful if you have multiple tables in the same column.

Resources