How to use match function of excel to change cell value - excel

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.

Related

How to make a cell automatically update value based upon information in another cell

I have a spreadsheet used for batching products at work. In column A there are product codes and column B the product description. Is there a way to make column B automatically update based upon the product code in column A?
I tried an IFS( function, but that didn't seem to work and felt like a long winded approach to get the result I desired. Is there another method, perhaps setting up another sheet with all the information in to reference?
A simple example of getting a description based on part of a code:
VLOOKUP(LEFT(A2,1),$A$13:$B$19,2,0)
And using index() with match() based on the same table:
INDEX($B$13:$B$19,MATCH(LEFT(A2,1),$A$13:$A$19,0))

Using VLOOKUP and not only match on first value

I'm trying to use VLOOKUP to match activities with product codes, but run into an issue since VLOOKUP always returns the first match. I did a mockup below to describe my issue. To the left, I have a table with activity names and product codes.
To the right, in column G, I want to, based on matching activity names in column F with activity names in column A, assign the activities product codes from column B.
When I use VLOOKUP, it only matches with the first activity name and give all the activities with the same name the same product codes. I need them to get different product codes even if they have the same name. I want my function to "take the next one" on the list, when the first one is taken.
Should I try to use another function to solve this? Is it impossible with VLOOKUP? My 'real' document has like 2000 rows, and the solutions I found on Youtube was not good to scale.
Thanks in advance. I'm new to here so if I should clarify my question in any way, feel free to tell me.
If the raw is around 2,000 rows, you can use a nested index match with helper columns.
Add a rank in column C with the formula =COUNTIF(A2:$A$2,A2)
Then apply the same ranking in your output part as well (Ensure Activity Name is sorted so that the formula works), Output rank formula =IF(J2=J1,I1+1,1)
Formula that lists out the Product Code {=INDEX($B$2:$B$3190,MATCH(I2,IF($A$2:$A$3190=J2,$C$2:$C$3190),0))}
This is an array formula, you get the curly brackets by hitting control+shift+Enter instead of just Enter upon keying in the formula
If you are using excel 365, you can use UNIQUE formula.
=UNIQUE(A2:B18)

Excel Formula Vlookup the value by referring Row and Column

In the sheet1 i have a table called working days of the countries as shown in the below image.
In the Sheet2 i have 10 columns in that based on the country and month by referring the this table i am trying to populate the values, When i tried doing by Vlookup the first row alone getting populated, but in the second row the header from F1:T1 is getting changed to F2:T2 so rest of the cells showing as #NA.
Anyone can you please give a solution for my issue. Here is the formula i have used.
=VLOOKUP(I1,Sheet1!F2:T7,MATCH(Sheet2!M1,Sheet1!F1:T1,0))
Thanks in Advance.
You are missing the symbol $ to lock the ranges, and the false condition to match exact values in the VLOOKUP.
It should be like:
=VLOOKUP(I1,Sheet1!$F$2:$T$7,MATCH(M1,Sheet1!$F$1:$T$1,0),0)
Or instead of VLOOKUP use HLOOKUP like:
=HLOOKUP(M1,Sheet1!$F$1:$T$7,MATCH(I1,Sheet1!$F$2:$F$7,0),0)
In general, combining the INDEX and MATCH functions is a superior option to VLOOKUP. For example, =INDEX(Sheet1!F:F,MATCH(Sheet2!M1,Sheet1!F1:T1,0)). This allows you to go left-to-right or right-to-left as well.
Snip for Index Match functions Using Vlookup won't work here because in the 2nd table you are repeating the country, unlike the first table. Use a combination of index match function, this is little trickier than the vlookup but it will fulfill your requirements.
Since I don't have the exact table you shared so I created a table on my end and sharing the snip here.

Populate Excel table based on conditional options from another

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

Nested if function? Need to have cells change if the contents of other cells change?

Having a lot of trouble with this. I need to be able to alter this excel page so that when you type in a product name A, B, or C into the summary page, or the month, the actual and projected sales will automatically show up based on what you enter for product name and month.
I'm trying Nested IFS but the month cell B2 is formatted weird and =if(B2="Jan",10)doesn't make 10 show up. If that makes sense.
I think syntax of if statement is not correct.
Correct syntax is:
=IF( condition, [value_if_true], [value_if_false] )
Please check it and correct its syntax.

Resources