i have a little issue with excel doing this
let's say i have 4 cells
A,B,C,D
A and C are just identifiers ( they have same text )
but not ordered i want to perform a function that copy cell D content to B if they had the same identifier ( A and C )
example :
A B C D
something AsomethingA something CsomethingC
result :
A B C D
something CsomethingC something CsomethingC
i hope i didn't make it compliacted
thank you guys in advance!
I found out how to do it, i used Vlookup function
,here is it :
=IFERROR(VLOOKUP(A1;$C$1:$D$2000;2;FALSE);"NO MATCH FOUND")
In my case i had 2000 cells, you can edit it however you want
,have a nice day!
Related
I am creating a Product Decoder for a project.
Lets say, Our product can have a code such as "ABCDE" OR a code like "BCDEF".
ABCDE has a table of data that I use to decode using a lookup. For example AB can decode into "Potato" and CDE can decode into "Chip". So any combination with AB can be Potato "Anything else".
BCDER, BC can decode into "Veggie" so DER can code into "Chip".
I also use the 1/search method to take placements for the decode. Example =IFERROR(LOOKUP(2,1/SEARCH($E$19:$E$23,N18),$E$19:$E$23), "")
I concatenate all the decodes using =S2&" "&T2&" "&U2&" "&V2
Question is...if we are getting a huge amount of product code coming that I want to decode into one single column... How do I tell excel to use this table of data for ABCDE if product starts with "A", if not, use table of data that correlates to BCDER when product starts with "B".
Edit 1:
Here is my table, right side is where i look up the Part Number column N"
As you can see on column "W" I concatenate the date is Look up from columns O~V.
Column O Function: =IFERROR(LOOKUP(2,1/SEARCH($C$1:$C$7,N2),$C$1:$C$7), "")
On column N, I have two parts. One that starts with M and one that starts with K which is pretty standard.
Image two is me trying to use the IF Left but, it doesn't really work
=IF(LEFT(AA4,10) = "M ", W2, W18)
So How can I tell my excel page to use Table A1:A12 if part starts with "M*" and vice versa?
Let me know if this is confusing, I will do my best to clear things up.
First, a possible correction
I think this function does not give you what you say it does:
= IFERROR(LOOKUP(2,1/SEARCH($E$19:$E$23,N18),$E$19:$E$23), "")
You might mean:
= IFERROR( LOOKUP( 2, 1/SEARCH( $E$19:$E$23, N18 ), $F$19:$F$23 ), "" )
Because you want to look up the value in column E and return the value in column F. If that's not true, then skip the rest of this answer.
Now the solution
What you're trying to do is change the lookup array if the part number starts with a different letter. So, the IF( LEFT( combo mentioned by #BigBen should be used to modify the lookup array. I think it would look like this:
= IFERROR( LOOKUP( 2
,1/SEARCH( IF( LEFT( AA4, 1 ) = "M"
,$C$2:$C$12
,$C$19:$C$23 )
,N2 )
,IF( LEFT( AA4, 1 ) = "M"
,$D$2:$D$12
,$D$19:$D$23 )
)
,"")
Can someone help me out with a formula?
I have a large database and I`m trying to figure out, how to get the MAX amount used in January 2017 for a product X.
I have found the averages using - AVERAGEIFS(Avg.de.time!E3:E80231;Avg.de.time!A3:A80231;C2;Avg.de.time!C3:C80231;">="&H7;Avg.de.time!C3:C80231;"<="&EOMONTH(H7;0))
Column A - Item no.
Column B - Supplier name
Column C - Order date
Column D - Receive date
Column E - Delivery time (D-C)
I`ve spent too many hours on trying to figure this out.
So I m asking for Help :)
Using array formulae you can rewrite your AVERAGEIFS statement using a conditional array expression as follows:
=AVERAGE(
IF(
(
(Avg.de.time!A3:A80231 = C2) *
(Avg.de.time!C3:C80231 >= H7) *
(Avg.de.time!C3:C80231 <= EOMONTH(H7,0))
) > 0,
Avg.de.time!E3:E80231
)
)
I've just formatted the code to make it easier to see where each of the criteria, criteria_ranges and value_range appear however this will obviously be one long line in your cell.
It's now very simple to swap out AVERAGE at the start with MAX, MIN or another aggregate function with the rest of the formula remaining identical.
=MAX(
IF(
(
(Avg.de.time!A3:A80231 = C2) *
(Avg.de.time!C3:C80231 >= H7) *
(Avg.de.time!C3:C80231 <= EOMONTH(H7,0))
) > 0,
Avg.de.time!E3:E80231
)
)
As this is an array formula, you will need to type it into your Excel cell and hit Ctrl-Enter to make it an array formula. You can check this worked as curly braces {} will appear around the formula.
A C D
12:58:09 12:58:09 400.9
12:58:16 12:58:10 468.0
12:58:20 12:58:11 425.9
12:58:34 12:58:12 432.4
12:58:38 12:58:13 439.3
12:58:49 12:58:14 442.5
12:58:53 12:58:15 445.2
12:58:56 12:58:16 447.2
12:59:00 12:58:17 449.7
12:59:04 12:58:18 450.4
12:59:07 12:58:19 453.9
12:59:11 12:58:20 454.3
I have a data set like this. I want to make a new helper column B that matches column A and C and gives the value D. So my Bshould look like 400.9, 447.2, 454.3, and so on. Can anyone suggest me what approach should I use for this problem? Thanks!
Put this in column B and drag it down:
=VLOOKUP(A1,$C$1:$D$100,2,FALSE)
All,
I am currently faced with an issue where I need to fetch the first instance of a value in a column, but I have multiple values. No two rows will be the same EXCEPT for the first column.
Example:
A 1 !
A 2 #
B 3 #
B 4 $
C 5 %
C 6 ^
D 7 &
D 8 *
After filter:
A 1 !
B 3 #
C 5 %
D 7 &
Would anyone have a way to go about this? Thanks in advanced.
Edit: Jeeped literally pointed something out that I have been doing for a long time, but didn't even think would work in this instance.
To solve this item, utilize the "Remove Duplicates" on the column in question (Column 1), but make sure you expand the selection. However, uncheck all the columns, and recheck only Column 1 for the criteria.
Thanks.
I am assuming you are trying to extract unique values from each column. If so, Excel has a built in function called Advanced Filter, which will do exactly that.
This tutorial will familiarize you with the feature
http://www.excel-easy.com/examples/advanced-filter.html
Hope that helps
I want to find the location of one string (which I take it from a table) inside of a cell:
A is my table, and B is the cell.
I have tested :
strncmp(A(1,8),B(:,1),1)
but it couldn't find the location.
I have tested many commands like:
ismember,strmatch,find(strcmp),find(strcmpi)find(ismember),strfind and etc ... but they all give me errors mostly because of the type of my data !
So please suggest me a solution.
You want strfind:
>> strfind('0123abcdefgcde', 'cde')
ans =
7 12
If A is a table and B a cell array, you need to index this way:
strfind(B{1}, A.VarName{1});
For example:
>> A = cell2table({'cde'},'VariableNames',{'VarName'}); %// create A as table
>> B = {'0123abcdefgcde'}; %// create B as cell array of strings
>> strfind(B{1}, A.VarName{1})
ans =
7 12
Luis Mendo's answer is absolotely correct, but I want to add some general information.
Your problem is that all the functions you tried (strfind, ...) only work for normal strings, but not for cell array. The way you index your A and B in your code snippet they still stay a cell array (of dimension (1,1)). You need to use curly brackets {} to "get rid of" the cell array and get the containign string. Luis Mendo shows how to do this.
Modified solution from a Mathworks forum, for the case of a single-column table with ragged strings
find(strcmp('mystring',mytable{:,:}))
will give you the row number.