Which value occurs first between (value 1) and (value 2) in row

rma8615

New Member
Joined
Jun 14, 2013
Messages
9
Hello all,

I work a lot with urls and I am currently stuck. I'm hoping someone can help!

In the example below I have two searches *cart* and *coupons*.
I normally use this

=IF(TYPE(HLOOKUP(B$2,$C5:$K5,1,FALSE))=2, 1,IF(TYPE(HLOOKUP(B$3,C5:$K5,1,FALSE))=2, 1,0))

to find if either search appears and return a 1 or 0.

--

In this case, I want to know which page each person visited first instead of just checking for the values alone. So far, this is what I've come up with

=AND(TYPE(HLOOKUP(B$2,$C5:$K5,1,FALSE)=2),TYPE(HLOOKUP(B$3,$C5:$K5,1,FALSE)=2))

This will return true/false if both occur, but I then want to nest it in an if statement to say,

=IF(AND(TYPE(HLOOKUP(B$2,$C5:$K5,1,FALSE)=2),TYPE(HLOOKUP(B$3,$C5:$K5,1,FALSE)=2))=TRUE,[find which of the searches occurs first in the same range returning either "cart" or "coupons"],"")

Thanks in advance for any help that you can provide!
If there is an easier way to do any of this, it would be much appreciated! Unfortunately, the range of urls also includes the page title and time spent on that page.




*cart*
*coupons*
IDCart or coupons first?Page 1 urlPage 1 titlePage 1 time spentPage 2 urlPage 2 titlePage 2 time spentPage 3 urlPage 3 titlePage 3 time spent
1Cartwww.test.com/cartcheck out page101www.test.com/otherother25www.test.com/coupons.aspxgreat deal!10
2Couponswww.test.com/coupons.aspxgreat deal!109www.test.com/cartcheck out page38www.test.com/otherother12

<tbody>
</tbody>
 
Last edited:

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
I ended up solving the problem!

=IF(ISNA(OR(MATCH(DR$5,$GL7:$ME7,0),MATCH(DR$4,$GL7:$ME7,0))),"",IF(MATCH(DR$5,$GL7:$ME7,0)<MATCH(DR$4,$GL7:$ME7,0),1,2))

If you see a shorter way of doing this.. please let me know.

Thanks everybody. (myself included on this one)
 
Upvote 0

Forum statistics

Threads
1,216,456
Messages
6,130,743
Members
449,588
Latest member
accountant606

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top