I posted this Qn at
https://www.mrexcel.com/forum/excel-questions/1029120-sumporduct-matched-criteria-extracted-text.html?posted=1#post4939092
but nobody was able to answer it.
G3=SUMPRODUCT(($B$1:$E$1=mid(G1,3,4))*($B$2:$E$2=G2)*($B$3:$E$6))
Basically using mid(G1,3,4) is causing the error. How do I solve it?
Thank you
Its not entirely clear what you are trying to achieve, but if your MID expression is supposed to extract and compare the year you have 2 problems:
1) its not extracting the year correctly
2) you are comparing a text value with a numeric value
Try using VALUE(MID(G1,1,4)))
Related
I’ve a value eg: 3,100,000.24 in a cell, which I want to mention in comments automatically.
Eg: Increase in xx by 3.1MM
I tried using formula:
="Decrese in X by "&TEXT(J22,"[<999950]0.0,"K";[<999950000]0.0,,"M";0.0,,,"B"")
However, it gives me an error.
Can someone please help me on this.
Issue is related to excel.
Thanks in advance..
Not sure if I get what you want to do, but in TEXT(J22,"[<999950]0.0,"K" the quotes before K matches the one before [<999950]0.0,, closing the text and leaving your K is loose in the formula. Similar thing with the M and B.
I am trying to extract the text to the right of a character pattern of form -201*-*- in excel (I also tried using Access, but the issue persists).
For example, in the text:
EP-005-FI6-2012-1-124-000000-1
I want to extract the number 124; the following formula works:
=LEFT(RIGHT(C1,SEARCH("-201*-*-",C1)+1),3)
124
However, when i apply the exact same formula to extract169 from the text below:
NAATS-MG-D6-2017-1-169-070000-1
The formula returns a completely different result:
=LEFT(RIGHT(C540495,SEARCH("-201*-*-",C540495)+1),3)
-16
The pattern is the same, but the results is completely differnt.
My dataset is too big to go row by row fixing the issue...
Seems to be a simple problem, but i can't get this working...
Any thoughts?
Thank you
Your RIGHT() is wrong. Use:
=LEFT(MID(C1,SEARCH("-201?-?-",C1)+8,9999),3)
I can get a two possibility formula to work but not a three. I thought it would just be adding a comma for another term then adding a comma for a value. Please can anyone tell me why its not working?
Working one:
=IF(OR(C6="buy", C6="hold"),(F5*(D6+1)),(E5*(D6+1)))
Not Working:
=IF(OR(C6="buy", C6="hold", c6="sell"),(F5*(D6+1)),(E5*(D6+1)),0)
After reading your problem description couple of times over I think you need below formula:
=CHOOSE(MATCH(C6,{"buy","hold","sell"},0),(F5*(D6+1)),(E5*(D6+1)),0)
In your second formula you have two parts (E5*(D6+1)) and 0 for the Value is False section, this version will work: =IF(OR(C6="buy", C6="hold", C6="sell"),(F5*(D6+1)),(E5*(D6+1)))
I have an issue with the formula below.
=VLOOKUP(B$22,Scenarios.New!$A$1:$M$211,MATCH(Output!$A27,Scenarios.New!$A$1:$M$1,0),FALSE)
Take a look at the image
This is basically doing one thing. Find the Action No. that is in the sheet "Scenario.New" of the Scenario ID 1017. It is working fine, as it returns 1,so formula is working, but sometimes I have 2 actions.
As you see. my formula will only look at the first Scend ID and will ignore the other one as is already found the first one. What I want to do is add a piece in the code that says Action No. = 1 or 2. Because based on the action No. some other fields will change too. Any ideas to solve it? Thanks!
first, i'm doubt with your question. second, your tabel is horisontal but you use VLOOKUP? or im wrong to undertand this?
but let me help you,i think you should try this,
table
enter image description here
=HLOOKUP(A5;Sheet1!$A$4:$G$5;2;FALSE)
take number 1 or 2 from table. but, if your table have double value be reference like image, HLOOKUP return first reference.
I have a spreadsheet with hundreds of URLs. Each URL has a search-engine friendly name in it, followed by a numeric ID, with a "/1" at the end. here's an example:
http://www.somesite.com/directory/varying-file-names-Guide/431/1
in this case, the 431 is the numeric ID. I'm trying to extract this numeric ID into its own column, but my lack of Excel knowledge is definitely holding me back. I've found a few examples, but my attempts to customize these example to match my needs results in errors. In all cases, the value I need to extract will always be between "-Guides/" and "/1" in the URL.
any help would be greatly appreciated.
thanks!
Assuming your URL in A1 try this formula in B1 to extract that number
=REPLACE(LEFT(A1,LEN(A1)-2),1,SEARCH("Guide/",A1)+5,"")
assumes "Guide" not "Guides" - if it's "Guides" then the 5 needs to be a 6.....,i.e.
=REPLACE(LEFT(A1,LEN(A1)-2),1,SEARCH("Guides/",A1)+6,"")
...or a different approach that will extract any number that ends at the 3rd charcater from the end
=LOOKUP(10^5,RIGHT(LEFT(RIGHT(A1,7),5),{1,2,3,4,5})+0)
extracts up to 5 digits
This formula should work regardless of the word preceding the numeric ID. Assuming your URL is in cell A1,
In cell B1:
=SUBSTITUTE(LEFT(A1, LEN(A1) - 2), "/","||", LEN(LEFT(A1, LEN(A1) - 2)) - LEN(SUBSTITUTE(LEFT(A1, LEN(A1) - 2), "/","")))
In cell C1:
=RIGHT(B1,LEN(B1)-FIND("||",B1)-1)
Thanks to everyone who answered. A co-worker of mine also came up with a different approach that also worked.
=MID(A6,FIND("uide/",A6,1)+5,LEN(A6)-FIND("tion/",A6,1)-6)
I thought I'd include this for anyone else facing the same issue. Interesting to see the various ways people approach the problem.