• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Finding and recording a value from a previous day.

eclairs

New Member
Hello everybody

For the date (column b), I want to see if the value in (column c) appears one day earlier after 03:00 (columns b and a)

Eg - for 10/19/20 the value apple does appear on row 7 on 10/18/20 after 03:00

For the instances when this occurs can a word be recorded in the original row in (column d) as text saying “match” ?

Worksheet attached, thanks for your time.
 

Attachments

vletm reapplied the date formats and verified as you said. I think the date formatting is corrected now.
Resubmitting a fresh upload file.
Any ideas on a formula for the original question? Thanks for your ideas.
 

Attachments

From the original file, Power Query alternative.
Code:
let
    Source = Excel.CurrentWorkbook(){[Name="tFruits"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"time", type time}, {"date", type text}, {"fruit", type text}}),
    #"Changed Type with Locale" = Table.TransformColumnTypes(#"Changed Type", {{"date", type date}}, "en-US"),
    AddColEarlierDate = Table.AddColumn(#"Changed Type with Locale", "1DayEarlierDate", each Date.AddDays([date],-1)),
    Join = Table.NestedJoin(AddColEarlierDate, {"1DayEarlierDate", "fruit"}, AddColEarlierDate, {"date", "fruit"}, "tFruits", JoinKind.LeftOuter),
    AddColMatch = Table.AddColumn(Join, "Match", each not List.IsEmpty(List.Select([tFruits][time], each _ > #time(3,0,0)))),
    #"Removed Columns" = Table.RemoveColumns(AddColMatch,{"1DayEarlierDate", "tFruits"})
in
    #"Removed Columns"
 

Attachments

Used Peter Bartholomew’s formula and it works. I will look into the Power Query alternative as I’ve never used it before.
Thanks to each of you for your time, awesome work!
 
Back
Top