Extract Parameter from URL Excel - excel

does anybody has an excel formula for me which just gives me back the clickid parameter? Unfortunately this parameter is not always at the same position so I can't fix it with character count. It should always be between &clickid= and &
https://app.appsflyer.com/id770725904?pid=website_adwords&c=C_DEU_billig&tl_rf=https%3A%2F%2Fwww.google.com%2F&tl_nw=g&tl_mt=e&clickid=EAIaIQobChMIj5zchvqs4AIVQamaCh06NQlOEAAYASACEgJhRPD_BwE&af_keywords=billig+telefonieren+nach+iran&af_c_id=1597316081&af_adset_id=60710335432&af_ad_type=1t1&af_adset=Iran&af_ad_id=303032652682

Well for sure a regular expression will be able to find this, but a rather simple formula could do the trick aswell. For example:
=MID(A1,FIND("clickid=",A1)+8,FIND("&",A1,FIND("clickid=",A1)+8)-(FIND("clickid=",A1)+8))

This will work but someone may have a tidier option ...
=LEFT(SUBSTITUTE(MID(A1,FIND("clickid",A1),1000),"clickid=", ""),FIND("&",SUBSTITUTE(MID(A1,FIND("clickid",A1),1000),"clickid=", ""))-1)
Throw your URL into cell A1 and test it out.

Related

Basic IF Statement question -probably right in front of me

Sorry i know this is super basic but i didn't know where else to ask and i really feel like the answer is right in front of me...
I have a spreadsheet which im going to use to log PAT test results. When i select the test type from a drop down it changes the standards and thresholds in the bit below and will tell me if each test passes or fails. It uses several vlookups and relative references - so far no VBA. Looking at this photo. What I'm trying to do is get the formula in cell I13 to read the symbol in F13 and use that in the formula rather than typing the symbol directly into the formula as its going to change when i change the Class Type option.
So far ive gotten to this (has a blank IF to start with to keep it neat:
=IF(H13="","",IF((H13&F13&(VALUE(G13))),"PASS","FAIL"))
The bit in bold is where the issue is. When i run the evaluate formula it boils the bold bit down to "0.01>2" which is correct however it then wont read that in the larger IF statement - i think its the quotation marks. So i think it needs another function to allow the IF statement to read that as the logical test rather than a text string.
I've tried VALUE, FORMULATEXT, NUMBERTEXT, all the ones that might be close to what I'm trying to do but 100% stumped now. Always bring sup the #VALUE Error.
Appreciate any advice? TIA
There is no built-in function for that. You need either a VBA function or the old EVALUATE XLM function (which you can't use directly in a cell, it has to be in a defined name). Sample UDF:
Function EvaluateFormulaString(FormulaString as string)
EvaluateFormulaString = application.evaluate(formulastring)
End Function
then your formula would become:
=IF(H13="","",IF(EvaluateFormulaString(H13&F13&(VALUE(G13))),"PASS","FAIL"))

IF AND Statement

I have the following If statement which is working the way I want it too.
However I need to add an extra condition where IF C7 has no data in it then it will show as 0. At the moment the cell the formula is in is showing #VALUE.
I think that I will need to use IF(AND however my attempts have failed me.
=IF(C6="BT",12.88+(C7-30)*0.6,IF(C7<35,4.3,4.3+(C7-35)*0.2))
Thanks
You could check for blanks first.
=If(c7="",0,IF(C6="BT",12.88+(C7-30)*0.6,IF(C7<35,4.3,4.3+(C7-35)*0.2)))
I just thought to add another approach I often use because I think it makes it easy to read is;
=If(c7="",0,1)*IF(C6="BT",12.88+(C7-30)*0.6,IF(C7<35,4.3,4.3+(C7-35)*0.2))
And there's another to skin this cat...
=Iferror(IF(C6="BT",12.88+(C7-30)*0.6,IF(C7<35,4.3,4.3+(C7-35)*0.2)),0)

Excel VLOOKUP issue

I have a problem on a VLOOKUP function in an Excel.
Basically i am trying to search a route from another spreadsheet, using a reference number.
- example: I put in a reference (lets say WPC 80) and i want to get a route (for this ex it should be Pitesti - Wrzesnia:
The problem is that it gives me something random.
I know that maybe im not using it correctly, but do you have any idea?
Thank you!
As noted in VLOOKUP documentation, the last parameter contols whether to use Exact Match or Approximate Match.
Try using exact matching:
=VLOOKUP(..., FALSE)
Sorry not enough rep to post a comment. When using vlookup, and the Range_Lookup parameter is TRUE, the lookup table must be sorted in ascending order, or you will get unusual results. Also ensure you put an absolute reference on the lookup table for when you drag it down.
Better use INDEX and MATCH combination, faster and far more reliable.

Using trim function on table references

I'm attempting to aggregate from an imported data source in excel. I have 2 combo boxes that specify conditions for a sumifs function (selected using offsets).
Where I struggle is that the data doesn't seem to match unless I use a trim function (I tested this on by adding a column to the data table).
The following formula always returns 0
=SUMIFS(Table_ExternalData_1[RedFlag],Table_ExternalData_1[RAGSTATUS],"=trim("&ReconAggregation!$A4&")",Table_ExternalData_1[ClientDescription],"=trim("&OFFSET(Lists!$A$1,Lists!$B$1,0)&")", Table_ExternalData_1[AgencyDescription],"=trim("&OFFSET(Lists!$C$1,Lists!$D$1,0)&")")
when I add the trims
=SUMIFS(Table_ExternalData_1[RedFlag],trim(Table_ExternalData_1[RAGSTATUS]),"=trim("&ReconAggregation!$A4&")",trim(Table_ExternalData_1[ClientDescription]),"=trim("&OFFSET(Lists!$A$1,Lists!$B$1,0)&")", trim(Table_ExternalData_1[AgencyDescription]),"=trim("&OFFSET(Lists!$C$1,Lists!$D$1,0)&")")
it tells me that I have a formula error. Any idea why? Is there a better way to do this?
Cheers,
G
it tells me that I have a formula error
Maybe there's problem with your "
=SUMIFS(Table_ExternalData_1[RedFlag],trim(Table_ExternalData_1[RAGSTATUS]),"=trim('&ReconAggregation!$A4&')",trim(Table_ExternalData_1[ClientDescription]),"=trim('&OFFSET(Lists!$A$1,Lists!$B$1,0)&')", trim(Table_ExternalData_1[AgencyDescription]),"=trim('&OFFSET(Lists!$C$1,Lists!$D$1,0)&')")
As It happens, the "=" were not required on the right hand side. This was found through trial and error. Still unsure as to why the trim function on the left prompted an error, but with additional cleansing of the source data it wasn't required. Thanks all for your input.

Excel Match multiple criteria

Could someone help me turn this 2 Criteria match function into a 4 criteria match function please? This one works, but is only the start:
=INDEX(range1,MATCH(1,(A19=range2)*(B19=range3),0))
I also want a third and fourth match in the above formula, with those two being an OR option. I thought based upon the working version that this might work, but it doesn't:
=INDEX(range1,MATCH(1,(A19=range2)*(B19=range3)*(OR(C19=range4,D19=range5)),0))
I've been trying to use AND commands, my initial version of the first code above being this:
=INDEX(range1,MATCH(1,AND(A19=range2,B19=range3),0))
It always returns #N/A after CTRL+ALT+ENTER is entered though, so it's obviously an issue with my understanding of either MATCH or AND (or both I guess),
The first example works EXACTLY as intended, but unfortunately I don't know why and I can't work it out well enough to adapt it. Maybe I'm too tired and have run out of space in my head for the peculiar way in which Excel formulas work, but I've read and re-read the help files for them and still it doesn't make sense to me.
Any help would be greatly appreciated, as always.
Thanks,
Joe
I'm just guessing here, but would this work?
=INDEX(range1,MATCH(1,(A19=range2)*(B19=range3)*(((C19 = range4)+(D19 = range5))>0),0))

Resources