# Using findfirst with for multiple values and columns in a Dataframe?

**URL:** <https://discourse.julialang.org/t/using-findfirst-with-for-multiple-values-and-columns-in-a-dataframe/111953>\
**Category:** New to Julia\
**Tags:** dataframes\
**Created:** [March 21, 2024, 9:35pm UTC](https://discourse.julialang.org/t/using-findfirst-with-for-multiple-values-and-columns-in-a-dataframe/111953 "2024-03-21T21:35:56Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![rocco\_sprmnt21](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rocco_sprmnt21/32/20127_2.png) [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Post date:** [March 24, 2024, 6:42am UTC](https://discourse.julialang.org/t/using-findfirst-with-for-multiple-values-and-columns-in-a-dataframe/111953/21 "2024-03-24T06:42:11Z")

</div>

Yes, certainly. That was the form I used to do a sort of self-test on syntax.  
The appropriate form for the problem posed is the following

```julia
 searchsortedfirst(eachrow(df2), (dates=Date("2024-02-24"),times=Time("15:00:00")), by=r->(r.dates,r.times))

```

To further clarify the doubt on the issue of the empty collection:

```julia

julia> searchsortedfirst([],3)
1

```

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [March 24, 2024, 10:38am UTC](https://discourse.julialang.org/t/using-findfirst-with-for-multiple-values-and-columns-in-a-dataframe/111953/22 "2024-03-24T10:38:18Z")

</div>

Since it seems a bit related, take a look here [Fastest way to fetch an index](https://discourse.julialang.org/t/fastest-way-to-fetch-an-index/111725) where we designed alternatives to searchsortedlast it might give you more ideas

[Previous page](https://discourse.julialang.org/t/using-findfirst-with-for-multiple-values-and-columns-in-a-dataframe/111953.md?page=1)
