Forum Discussion

sruk89's avatar
sruk89
Brass Contributor
Dec 06, 2024

** Help ** Need to filter same result but in different formulas dependent on Quarter

Hi  HansVogelaar 

I need help modify my formula/logic (request below)

Formula 1
=TEXTJOIN("; ", TRUE,
    FILTER(
        Catalogue!$B$3:$B$987 &
        IF((Catalogue!$L$3:$L$987 = E$1 & "+"), "Q1'25+", "") &
        IF(Concat!$B$1 = "XXX Group",
            IF(TRUE,
                IF(Catalogue!$M$3:$M$987 = "Y", " UK", "") &
                IF(Catalogue!$O$3:$O$987 = "Y", " IT", "") &
                IF(Catalogue!$Q$3:$Q$987 = "Y", " DE", ""),
            ""),
        ""),
        (Catalogue!$A$3:$A$987 = $D$1) *
        (Catalogue!$C$3:$C$987 = $D2) *
        IF(Concat!$B$2 = "POR",
            (Catalogue!$F$3:$F$987 = "POR"),
        IF(Concat!$B$2 = "POI",
            (Catalogue!$F$3:$F$987 = "POI"),
        IF(Concat!$B$2 = "Both",
            (Catalogue!$F$3:$F$987 = "POR") + (Catalogue!$F$3:$F$987 = "Both"),
        TRUE))) *
        IF(Concat!$B$1 = "Superset",
            ((Catalogue!$J$3:$J$987 = E$1) + (Catalogue!$J$3:$J$987 = E$1 & "+")) *
            (Catalogue!$I$3:$I$987 = "Y"),
        IF(Concat!$B$1 = "XXX Group",
            ((Catalogue!$L$3:$L$987 = E$1) + (Catalogue!$L$3:$L$987 = E$1 & "+")) * (Catalogue!$K$3:$K$987 = "Y"),
        IF(Concat!$B$1 = "XXX UK & ROI",
            ((Catalogue!$N$3:$N$987 = E$1) + (Catalogue!$N$3:$N$987 = E$1 & "+")) * (Catalogue!$M$3:$M$987 = "Y"),
        IF(Concat!$B$1 = "XXX IT",
            ((Catalogue!$P$3:$P$987 = E$1) + (Catalogue!$P$3:$P$987 = E$1 & "+")) * (Catalogue!$O$3:$O$987 = "Y"),
        IF(Concat!$B$1 = "XXX DACH",
            ((Catalogue!$R$3:$R$987 = E$1) + (Catalogue!$R$3:$R$987 = E$1 & "+")) * (Catalogue!$Q$3:$Q$987 = "Y"),
        IF(Concat!$B$1 = "XXX CHOPS",
            ((Catalogue!$T$3:$T$987 = E$1) + (Catalogue!$T$3:$T$987 = E$1 & "+")) * (Catalogue!$S$3:$S$987 = "Y"),
        IF(Concat!$B$1 = "Omux",
            ((Catalogue!$V$3:$V$987 = E$1) + (Catalogue!$V$3:$V$987 = E$1 & "+")) * (Catalogue!$U$3:$U$987 = "Y"),
        IF(Concat!$B$1 = "Letxof",
            ((Catalogue!$X$3:$X$987 = E$1) + (Catalogue!$X$3:$X$987 = E$1 & "+")) * (Catalogue!$W$3:$W$987 = "Y"),
        IF(Concat!$B$1 = "DT",
            ((Catalogue!$Z$3:$Z$987 = E$1) + (Catalogue!$Z$3:$Z$987 = E$1 & "+")) * (Catalogue!$Y$3:$Y$987 = "Y"),
        FALSE)))))))) *
        TRUE
    ),
    "None")
)

Request

There are two things that I'm expecting to see return

1.)
B243 = Test - do not remove
M243 = Y (UK)
N243 = Q1'25
O243 = Y (IT)
P243 = Q2'25

Id expect to see returned in formula 1 (E2) "Test - do not remove UK" as this formula is looking for Q1'25 values in formula 2 (F2) id expect to see "Test - do not remove IT" as this is looking for Q2'25 values

2.) 

B306 = Migrate Verdi & Beethoven
O306 = Y (IT)
P306 = Q2'25
Q306 = Y (DE)
R306 = Q1'25

Id expect to see Migrate Verdi & Beethoven DE in formula 1 as this is a Q1'25 value and id expect to see Migrate Verdi & Beethoven IT in returned in formula 2 as this is a Q2'25 value

This logic should only apply when B3 = XXX Group on "Concat Tab"


Formula Tab - so essentially instead of seeing Test - Do not remove UK IT in E2 Id like to see Test- Do not remove UK as it in Q1'25 for UK and then id expect to see in F2 "Test - Do not remove IT" as its in Q2'25 for IT and the same for E6 I expect to see "Migrate Verdi & Beethoven DE" as its in Q1'25 and Migrate Verdi & Beethoven IT in F6 as its in Q2'25

Catalogue Tab

Catalogue Tab

 

11 Replies

  • sruk89's avatar
    sruk89
    Brass Contributor

    hopefully this will be a bit clearer HansVogelaar 

    B243 = Test - do not remove
    M243 = Y (UK)
    N243 = Q1'25
    O243 = Y (IT)
    P243 = Q2'25

    Id expect to returned in formula 1 "Test - do not remove UK" as this formula is looking for Q1'25 values in formula 2 id expect to see "Test - do not remove IT" as this is looking for Q2'25 values


    Here is an example of what i'd like to see with my simplified logic

    =TEXTJOIN("; ", TRUE,

        FILTER(

            Catalogue!$B$3:$B$987 &

            IF(Catalogue!$N$3:$N$987 = E$1, " UK", "") &

            IF(Catalogue!$P$3:$P$987 = E$1, " IT", ""),

            (Catalogue!$A$3:$A$987 = $D$1) *

            (Catalogue!$C$3:$C$987 = $D2)

        ),

        "None"

    )

  • NikolinoDE's avatar
    NikolinoDE
    Platinum Contributor

    For Formula 1 (for UK, IT, etc. based on Q1'25):

    =TEXTJOIN("; ", TRUE,
        FILTER(
            Catalogue!$B$3:$B$987 &
            IF((Catalogue!$L$3:$L$987 = E$1 & "+"), "Q1'25+", "") &
            IF(Concat!$B$1 = "XXX Group",
                IF(TRUE,
                    IF(Catalogue!$M$3:$M$987 = "Y", " UK", "") &
                    IF(Catalogue!$O$3:$O$987 = "Y", " IT", "") &
                    IF(Catalogue!$Q$3:$Q$987 = "Y", " DE", ""),
                ""),
            ""),
            (Catalogue!$A$3:$A$987 = $D$1) *
            (Catalogue!$C$3:$C$987 = $D2) *
            IF(Concat!$B$2 = "POR",
                (Catalogue!$F$3:$F$987 = "POR"),
            IF(Concat!$B$2 = "POI",
                (Catalogue!$F$3:$F$987 = "POI"),
            IF(Concat!$B$2 = "Both",
                (Catalogue!$F$3:$F$987 = "POR") + (Catalogue!$F$3:$F$987 = "Both"),
            TRUE))) *
            IF(Concat!$B$1 = "Superset",
                ((Catalogue!$J$3:$J$987 = E$1) + (Catalogue!$J$3:$J$987 = E$1 & "+")) *
                (Catalogue!$I$3:$I$987 = "Y"),
            IF(Concat!$B$1 = "XXX Group",
                ((Catalogue!$L$3:$L$987 = E$1) + (Catalogue!$L$3:$L$987 = E$1 & "+")) * (Catalogue!$K$3:$K$987 = "Y"),
            IF(Concat!$B$1 = "XXX UK & ROI",
                ((Catalogue!$N$3:$N$987 = E$1) + (Catalogue!$N$3:$N$987 = E$1 & "+")) * (Catalogue!$M$3:$M$987 = "Y"),
            IF(Concat!$B$1 = "XXX IT",
                ((Catalogue!$P$3:$P$987 = E$1) + (Catalogue!$P$3:$P$987 = E$1 & "+")) * (Catalogue!$O$3:$O$987 = "Y"),
            IF(Concat!$B$1 = "XXX DACH",
                ((Catalogue!$R$3:$R$987 = E$1) + (Catalogue!$R$3:$R$987 = E$1 & "+")) * (Catalogue!$Q$3:$Q$987 = "Y"),
            IF(Concat!$B$1 = "XXX CHOPS",
                ((Catalogue!$T$3:$T$987 = E$1) + (Catalogue!$T$3:$T$987 = E$1 & "+")) * (Catalogue!$S$3:$S$987 = "Y"),
            IF(Concat!$B$1 = "Omux",
                ((Catalogue!$V$3:$V$987 = E$1) + (Catalogue!$V$3:$V$987 = E$1 & "+")) * (Catalogue!$U$3:$U$987 = "Y"),
            IF(Concat!$B$1 = "Letxof",
                ((Catalogue!$X$3:$X$987 = E$1) + (Catalogue!$X$3:$X$987 = E$1 & "+")) * (Catalogue!$W$3:$W$987 = "Y"),
            IF(Concat!$B$1 = "DT",
                ((Catalogue!$Z$3:$Z$987 = E$1) + (Catalogue!$Z$3:$Z$987 = E$1 & "+")) * (Catalogue!$Y$3:$Y$987 = "Y"),
            FALSE)))))))) *
            (Catalogue!$Q$3:$Q$987 = "Q1'25"),
        "None"
    )

     

    For Formula 2 (for IT, DE, etc. based on Q2'25):

    =TEXTJOIN("; ", TRUE,
        FILTER(
            Catalogue!$B$3:$B$987 &
            IF((Catalogue!$L$3:$L$987 = E$1 & "+"), "Q2'25+", "") &
            IF(Concat!$B$1 = "XXX Group",
                IF(TRUE,
                    IF(Catalogue!$M$3:$M$987 = "Y", " UK", "") &
                    IF(Catalogue!$O$3:$O$987 = "Y", " IT", "") &
                    IF(Catalogue!$Q$3:$Q$987 = "Y", " DE", ""),
                ""),
            ""),
            (Catalogue!$A$3:$A$987 = $D$1) *
            (Catalogue!$C$3:$C$987 = $D2) *
            IF(Concat!$B$2 = "POR",
                (Catalogue!$F$3:$F$987 = "POR"),
            IF(Concat!$B$2 = "POI",
                (Catalogue!$F$3:$F$987 = "POI"),
            IF(Concat!$B$2 = "Both",
                (Catalogue!$F$3:$F$987 = "POR") + (Catalogue!$F$3:$F$987 = "Both"),
            TRUE))) *
            IF(Concat!$B$1 = "Superset",
                ((Catalogue!$J$3:$J$987 = E$1) + (Catalogue!$J$3:$J$987 = E$1 & "+")) *
                (Catalogue!$I$3:$I$987 = "Y"),
            IF(Concat!$B$1 = "XXX Group",
                ((Catalogue!$L$3:$L$987 = E$1) + (Catalogue!$L$3:$L$987 = E$1 & "+")) * (Catalogue!$K$3:$K$987 = "Y"),
            IF(Concat!$B$1 = "XXX UK & ROI",
                ((Catalogue!$N$3:$N$987 = E$1) + (Catalogue!$N$3:$N$987 = E$1 & "+")) * (Catalogue!$M$3:$M$987 = "Y"),
            IF(Concat!$B$1 = "XXX IT",
                ((Catalogue!$P$3:$P$987 = E$1) + (Catalogue!$P$3:$P$987 = E$1 & "+")) * (Catalogue!$O$3:$O$987 = "Y"),
            IF(Concat!$B$1 = "XXX DACH",
                ((Catalogue!$R$3:$R$987 = E$1) + (Catalogue!$R$3:$R$987 = E$1 & "+")) * (Catalogue!$Q$3:$Q$987 = "Y"),
            IF(Concat!$B$1 = "XXX CHOPS",
                ((Catalogue!$T$3:$T$987 = E$1) + (Catalogue!$T$3:$T$987 = E$1 & "+")) * (Catalogue!$S$3:$S$987 = "Y"),
            IF(Concat!$B$1 = "Omux",
                ((Catalogue!$V$3:$V$987 = E$1) + (Catalogue!$V$3:$V$987 = E$1 & "+")) * (Catalogue!$U$3:$U$987 = "Y"),
            IF(Concat!$B$1 = "Letxof",
                ((Catalogue!$X$3:$X$987 = E$1) + (Catalogue!$X$3:$X$987 = E$1 & "+")) * (Catalogue!$W$3:$W$987 = "Y"),
            IF(Concat!$B$1 = "DT",
                ((Catalogue!$Z$3:$Z$987 = E$1) + (Catalogue!$Z$3:$Z$987 = E$1 & "+")) * (Catalogue!$Y$3:$Y$987 = "Y"),
            FALSE)))))))) *
            (Catalogue!$Q$3:$Q$987 = "Q2'25"),
        "None"
    )

    If that doesn't help, I recommend, like HansVogelaar, attaching a small example workbook that demonstrates the problem 🙂.

    My answers are voluntary and without guarantee!

     

    Hope this will help you.

  • Could you attach a small sample workbook demonstrating the problem (without sensitive data), or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar? Alternatively, you can attach it to a private message to me. Thanks in advance.

      • It's this part:

                    IF(TRUE,
                        IF(Catalogue!$M$3:$M$987 = "Y", " UK", "") &
                        IF(Catalogue!$O$3:$O$987 = "Y", " IT", "") &
                        IF(Catalogue!$Q$3:$Q$987 = "Y", " DE", ""),
                    ""),

        In Catalogue row 243, both M243 and O243 are "Y", so you concatenate "UK" and "IT". You do not check if each of the columns next to it contain Q1'25

Resources