Move cell based on info & place to next available cell - google-sheets

In a tab I have an SKU column & and an EMAIL column. I need to move the email cell based on the SKU next to it to a new tab and place it in the next available column following the SKU number that matches.
I'm trying to place each new order email in the next available edition (we sell limited editions of 25).

use VLOOKUP. example:
=INDEX(IFNA(VLOOKUP(A2:A10, Sheet1!A:B, 2, 0)))
update 1
=INDEX(IFNA(VLOOKUP(C2:C, {'TAB2'!B:B, 'TAB2'!A:A}, 2, 0)))
update 2:
use in E2 cell and drag to the right:
=INDEX(IFNA(VLOOKUP($C$2:$C, FILTER({'TAB2'!$B:$B, 'TAB2'!$A:$A},
NOT(REGEXMATCH('TAB2'!$A:$A, TEXTJOIN("|", 1, $D:D)))), 2, 0)))

Related

How to write latest record in Google Sheet formula and autofill?

I have a Google sheet - table 1 below and all the data is given. Table 1 data is people(VenderNo) claim that they want to join event with what data(EventStartDate) and what booth number(BoothNo). So the data is duplicated because people update it with new line and never allowd to delete or update the existing record(table 1).
Input data
And I also have a Google sheet - table 2 below and only EventStartDate and BoothNo are given. All I want to do is the result like table 2's VenderNo. The purpose of table 2 is trying to summarize which vendor is eventually joining the event with latest booth number.
Ideal result like blow:
Output data
May I know how to write this formula in table 2 column C (VendorNo) with autofill function like ={ "VendorNo"; unique(General!A2:A) } without hand dragging the formula?
Any thoughts and thank you.
P.S.: I am sorry I couldn't post image above directly because I don't have enough reputation.
Revision 1 for Mike Result: (Yellow highlight mismatched, since v001 should not join the same event date with 2 booths)
Revision 2 for Mike Result: (Yellow highlight mismatched, since v004 added to 2022-11-11 for BoothNo A01. BoothNo C01 doesn't erase as expected, Because same vendor(VendorNo) should only be with same date( EventStartDate) & latest booth selection(BoothNo))
Try
={"vendor";arrayformula(if(
iferror(vlookup(E2:E&"~"&F2:F,{B2:B&"~"&C2:C,A2:A,C2:C},3,0))
=
iferror(vlookup(vlookup(E2:E&"~"&F2:F,{B2:B&"~"&C2:C,A2:A},2,0)&"~"&E2:E,({unique({A2:A&"~"&B2:B}),(vlookup(unique({A2:A&"~"&B2:B}),SORT({A2:A&"~"&B2:B,C2:C,row(A2:A)},3,0),2,0))}),2,0),""),
iferror(vlookup(E2:E&"~"&F2:F,{B2:B&"~"&C2:C,A2:A},2,0)),""
))}
You don't need a Formula for that. Just select your columns and go to "Data" ->"Sort data"->"advanced sort settings" and then sort by column "EventStartDate" and secondly add sort by another column and add "BoothNo".
In the end you can run a data clean up to remove duplicates. You find it also under data.
to get the latest update from your table 1 you can use:
=SORTN(SORT(A2:C, B2:B, 0), 9^9, 2, 1, 1)
for your table 2 try:
={"VN"; INDEX(IFNA(VLOOKUP(E2:E&F2:F,
SORTN(SORT({B2:B&C2:C, A2:C}, B2:B, 0), 9^9, 2, 2, 1), 2, 0)))}

Fill previous row of a list automatically

I have a list of items with its transaction details. Columns contain date, item name, buy qty, buy rate, sell qty, sell rate etc.
I have added a column indicating the row in which this item has appeared earlier in the list. If item name is in column B, I can fill the formula
=IFNA(MAX(FILTER(ROW(B:B),A:A<INDIRECT(ADDRESS(ROW(),1)),B:B=INDIRECT(ADDRESS(ROW(),2)))),0)
which returns the row number where the current item has appeared. If the item is currently appearing the first time, the function returns 0. That works fine.
I would like to fill the entire column with the formula so that it fills when new row is added or updates when an item name is changed. How can I achieve it?
I tried QUERY to generate the entire column, but could not get the result. What is in my mind is something like
=FILTER(<function>,B:B<>"")
Can you suggest any methods?
try:
=INDEX(IF(A:A="",,IFNA(VLOOKUP(
B:B&COUNTIFS(B:B, B:B, ROW(B:B), "<="&ROW(B:B))-1, {
B:B&COUNTIFS(B:B, B:B, ROW(B:B), "<="&ROW(B:B)), ROW(B:B)}, 2, 0), 0)))
or:
=INDEX(IFNA(IF(COUNTIFS(B:B, B:B, ROW(B:B), "<="&ROW(B:B))=1, 0,
VLOOKUP(B:B, {B:B, ROW(B:B)}, 2, 0))))

Google Sheets - Add seperate columns and show sum on another sheet

Ok. Here's my problem. I have a sheet that is created by a Google Form. It is formated like this...
This is part of an INVENTORY CONTROL. This sheet is showing the INCOMING stock. What I want to do is ADD each column (that could go infinately) for example Col B SVHD-01-8OZCUP and display that number on G2 on the sheet below. I also have another sheet that is basically the same showing OUTGOING stock and the sum of its columns would go in H below.
Then I just Subtract H from G in each row to get the Current Inventory. All I need help on is getting the Check-In Totals and Check-Out Totals from the above sheet onto the below sheet. Thanks.
UPDATE 2:
Making the SEQUENCE part of the formula dynamic as per the discussion in comments:
=ArrayFormula(IFNA(VLOOKUP("sum "&A2:A, TRANSPOSE(QUERY({'Re-Order'!A1:DF}, "select "&TEXTJOIN(", ", 1, ("sum(Col"&SEQUENCE((COUNTA('Re-Order'!1:1)-1), 1, 2)&")"))&"", 1)), 2, 0)))
This will only work if you do not have empty columns in the sheet.
UPDATE:
Added this formula in D2 in your Test B sheet:
=ArrayFormula(IFNA(VLOOKUP("sum "&A2:A, TRANSPOSE(QUERY({'Re-Order'!A1:DF}, "select "&TEXTJOIN(", ", 1, ("sum(Col"&SEQUENCE(109, 1, 2)&")"))&"", 1)), 2, 0))) and it seems to be working. Let me know if you have any questions.
PREVIOUS ANSWER:
Based on the screenshots that you have shared (I have not looked at the sheet in the comments) one way to do it is to sum all columns individually in the form and then lookup the value against the product in the second sheet (screenshot 2 of your question)
You can use the following formula in G2 in your the sheet in screenshot 2 of your question:
=ArrayFormula(VLOOKUP("sum "&A2:A, TRANSPOSE(QUERY({inventory_control_sheet_nameA1:DF}, "select "&TEXTJOIN(", ", 1, ("sum(Col"&SEQUENCE(109, 1, 2)&")"))&"", 1)), 2, 0))
This assumes that the input has columns through DF.

How to use data from drop down menus and two other criteria to populate a table?

I am trying to set up a spreadsheet to summarise the amounts of money I transfer between four bank accounts. In the attached spreadsheet, I will manually put in the transfers I make between the different accounts (i.e., Everyday, Holiday, Emergency, Investments) in columns A, B, C, and D. In column A, you double-click a cell to add in a date, while columns B and C use a drop down box to choose accounts.
What I would like to do is have the information in these four columns populate the table on the right.
I've named columns B and C as "OUT" and "IN", respectively. For example, in my sheet, the second row means that on the 8th April, I'd taken $500 OUT of the Everyday account and put it IN the Holiday account.
So for the table on the right, I'd like for it to give me the totals for all the money I've transferred IN and OUT for each specific account for each specific month. Do you know what formulae I could use to do this if it's possible?
An example of my spreadsheet is here: https://docs.google.com/spreadsheets/d/1azNw6m7f3x7WhwEP9WXolCzfTE9dccj9wjs0qPwD-FY/edit#gid=2056599600
I have tried to use VLOOKUP and SUMIFS.
paste this into H3 cell and drag to the right - then drag down:
=IFERROR(SUM(QUERY({$A:$D},
"select Col4
where Col"&IFS(H$2="OUT", 2, H$2="IN", 3)&"='"&IF(H$1="", G$1, H$1)&"'
and month(Col1)+1="&MONTH($G3&1), 0)))
and for totals row paste this in H15 cell and drag to the right:
=SUM(H3:H14)
demo spreadsheet

find and replace from other tab

I'm trying to replace student email addresses with their plain text names. I have compiled all of the active student names and emails in another tab.
How would I go about searching 'SHEET2:A' (the entries) and adding to a new column everywhere it matches 'SHEET1:E' (email reference sheet) their name 'SHEET1:D' (name+ID)
Example Sheet https://docs.google.com/spreadsheets/d/1AGqBXCxWwWR2DnsagaxZJXeNg_KsJ7B26_MWyedqg84/edit?usp=sharing
If it would make it easier, I could move the reference section to SHEET2 in another column or way down in the rows. The entries will be random and will consist of multiple duplicates.
VLOOKUP is your friend:
=ARRAYFORMULA(IFERROR(VLOOKUP(A2:A, {Sheet1!E:E,Sheet1!D:D}, 2, 0)))
or if you want to put it in B1 cell:
={"First Last - ID"; ARRAYFORMULA(IFERROR(VLOOKUP(A2:A, {Sheet1!E:E,Sheet1!D:D}, 2, 0)))}
=ARRAYFORMULA(IFERROR(VLOOKUP(A2:A, {Sheet1!E:E,Sheet1!D:D}, 2, 0)))

Resources