SUMIFS + VLOOKUP tricky use in excel - excel

I've got two files with excel sheets
The first one consists of 2 columns
First one is ARTICLE (with article numbers), second one is QUANTITY (with product quantity)
Second file consists of two sheets
First sheet contains two columns is CODE (code numbers), second one is QUANTITY (with product quantity)
Second sheet consists of two columns CODE and ARTICLE
The thing is one code, for instance "2111", can contain up to 5-10 different articles
My goal is to find the right articles in the first file depending on the code in the second one and calculate the quantity in the second one.
THANK YOU SO MUCH for any insights!

Assume Article & Quantity are in column A and Column B, Code and Article are in columns E & F, Code and Quantity are in columns I & J.
Add a VLOOKUP formula in column G
=VLOOKUP(F2,$A$2:$B$4,2,FALSE)
and fill down.
in column J (this is is the answer column) add a SUMIF Formula:
=SUMIF($E$2:$E$7,I2,$G$2:$G$7)
and fill down
(your row numbers in the formulas will be different)

Related

Matching up information on Excel from 2 different sheets

In the next step of the analysis I'm currently working on I have one sheet with two important columns. Column A specifies gene name and Column B specifies a number I am interested in (first screenshot). Then, I have a second sheet that repeats Column A but the gene name entries are in a different order to the first sheet and a Column B which has a lettered classification system (A-Z) which gives me some detail regarding the function of that gene. I would like to match the Column A and Column B data from sheet 1 to the Column B data from sheet 2 but as the column A in both sheets is the same but in a different order, is there a way to get Excel to match the correct letter in the second sheet to the correct gene name and number in the first sheet? The screenshots are of fake test data just to help me clarify this text! Any help really appreciated.
Use Index/Match() like below-
=INDEX(Sheet2!$B$2:$B$20,MATCH(A2,Sheet2!$A$2:$A$20,0))
VLOOKUP() will also work
=VLOOKUP(A2,Sheet2!$A$2:$B$20,2,FALSE)
If you have Excel365 then use XLOOKUP() function.
=XLOOKUP(A2,Sheet2!$A$2:$A$20,Sheet2!$B$2:$B$20,"Not Found")

Using two values in a sheet to filter and return values from a table in another sheet

I'm fairly new to coding and i've been googling around for the last few hours trying to solve this problem but it seems to be a little beyond what i'm able to do so i would be very grateful for some help
In Sheet1, I have a table which has columns between M - CV (175 columbs). For each column, i have an "ID number" value in row 3. From Row 6 to the end of the table, i have several "search terms" separated by commas in the column CV
In Sheet2, the corresponding "ID Numbers" are in column B. Column AN contains strings.
For each ID Number value in sheet1, i'm looking to find find all the corresponding cells in sheet2 where the ID number in Column B is the same, and Column AN of sheet2 contains at least one of the "search terms" in column CV
For each ID number, i'm hoping to join the entries in Column AN of sheet2 which match the criteria above and paste them into Row 5 of the respective column in Sheet1
I've gone around in quite a few circles trying to do this and i'm back to square 1 with no code to show for it.
I've tried to research both the autofilter function, and using for loops. The research i've done indicates that for loops are rather slow to run for a large data set.
I'm hoping to find a solution which is as easy to read and understand as possible
I hope i've given enough information for everyone to understand and help
THank you in advance
My Excel subscription has expired an I've started using Google Sheets for most of my spreadsheet work, so I tested this there. Some conversion may be required. I did this using formulas, not VBA also, not sure if that changes things for you.
If I understand correctly, you have two sheets with a shared key column, sheet 1 contains search terms across multiple columns, and sheet 2 contains search terms comma delimited in a single column.
With this setup we want to bring the search term column of sheet 2 into the correct row of sheet 1 by key using VLOOKUP. I made a named range in sheets which contained all my data on sheet 2 and called it "dst". My formula was then =VLOOKUP(A2, dst, 7, true) since my key in sheet 1 was in column A, dst was the range I was searching, my column with my delimited search terms was column 7 in relation to dst, and I had ordered sheet 2 by key. I pasted this formula relatively down all rows as needed.
We want to construct a regex string using our search terms across multiple columns in sheet 1, into a single cell. I used =JOIN("|", B2:E2) on sheet 1 since my search terms were in columns B:E, and this resulted in a regex that looked like this for me: alligator|dog|rabbit|lizard where alligator, dog, rabbit, and lizard, were all search terms in that row. Paste down relative as needed.
We want to run our regex against our search target cell containing the comma delimited search terms. I ran =REGEXMATCH(F2, G2) where F2 was my delimited search terms from sheet 2, and G2 was my constructed regex for the row. Paste down relative as needed.
A screenshot of my completed sheet 1:
Once you know which cells have matches you can do whatever you want.

Spreadsheet summing based on substring match

I am struggling with one part of this exercise. I'm able to sum based on one column unique values (i.e. column G). I'm also to extract unique names from columns with multiple names in same cell (column I). What I am not able to do is get work assigned for the person from multiple rows. For simplicity, the work is just divided equally between number of people in that row.
Desired outcome is in column L. Sample sheet to work with is here
https://docs.google.com/spreadsheets/d/1xwv8IV-XNMArSFZEdT8mR-ZbOFHRFFZMfAm7dwm3bbE/edit#gid=741595390
Try it as (in J3),
=SUMPRODUCT((D$3:D$8)/(LEN(C$3:C$8)-LEN(SUBSTITUTE(C$3:C$8, " ", ""))+1), --ISNUMBER(SEARCH(I3, C$3:C$8)))

Combining multiple columns (Excel) into 1 with associated column of dates

Reviewed many threads on similar issues, but none addresses my particular challenge. I have a column (A) of dates (10K+), followed by a column (B) of event hosts, followed by multiple columns (C-X) of co-hosts. From these, I need to create 2 columns - 1 of dates and 1 combined list of hosts/co-hosts (each associated with their specific date). In other words, the co-host listings will be inserted into the host list (as a new row) and the appropriate associated date will be generated in the adjacent date column.
Caveats: (1) there are blank cells (in co-host columns), which need to be ignored; (2) the list will continue to expand each year (+~5K); (3) prefer a formulaic solution, if possible.
Can anyone assist? Many thanks!
For a formula way of doing this I would add the following formula into column Y
=B1
And then the following formula into Column Z:
=X1 & IF(LEN(C1)>0,", "&C1,"")
Then drag that formula across to the right for the 22 or so columns (the number between B and X). The last column should have what you are after, you could then Ctrl-X to a different part of the workbook. I have assumed you would like a column between the names. I hope that helps

How to lookup values and insert contents between two spreadsheets?

I have to manage a lot of information in Excel. I have two spreadsheets in one workbook. The first one shows different names on the second row (Abasolo TAMPS 1, Abasolo TAMPS 10, etc) and the second one shows also names (Column A) but next to them there are also some parameters like Wind Speed, Distance, X and Y (Column B). Does any one know how to programm in VBA a way to tell Excel to take the first value on the column A (Say Abasolo, TAMPS 17) on the second spreadsheet (image of the right), look them up in the second row of the first spreadsheet (image on the left), take the set of parameters next to the name and insert them on row 11 and the intersecting column on the first spreadsheet (image of the left, where the "2's" are). That for all the values on column A of the second spreadsheet.
You can VLOOKUP to achieve this.
Sheet 2 parameters
Sheet 1 VLookup
I used the function
=VLOOKUP(B$4,Sheet2!$A$2:$B$3,2,FALSE)
in Cell B6 on sheet1.
To maintain line breaks, you will need to ensure wrap text is used for the destination cells as shown below
You can read more about VLOOKUP here.
VLOOKUP

Resources