SOLVED

Returning a value based on multiple columns

Copper Contributor

Hi,

 

Need your kind support for one tricky case I have. 

 

I have the following in column in sheet1

 

Pointer
X1
X2
X3
X4
X5

 

And the following table in sheet2

PointerPrevious daytodaytomorrow 
X11000 
X2050 
X5151515 

 

I want to create a new column in sheet1 and populated with a text result after doing a search in sheet2 like the following:

PointerWhere is it?
X1Has value in previous day
X2Has value in today
X3Not Found
X4Not Found
X5Has value in previous day, today and tomorrow
  

 

Could you please help me finding out what would be the formula I should be using in the "Where is it?" column

 

Thank you, appreciated.

37 Replies

@abukapsoun 

Yes it's possible to count the occurrences. Thank you for this suggestion. This formula returns the expected results in the attached sheet in my understanding.

 

=IF(AND(COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$M$2:$M$227,">"&0)>0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$N$2:$N$227,">"&0)>0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$Q$2:$Q$227,">"&0)=0),"Has value in previous and today",IF(AND(COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$M$2:$M$227,">"&0)=0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$N$2:$N$227,">"&0)>0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$Q$2:$Q$227,">"&0)=0),"Has value in today",IF(AND(COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$M$2:$M$227,">"&0)=0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$N$2:$N$227,">"&0)=0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$Q$2:$Q$227,">"&0)>0),"Has value in tomorrow",IF(AND(COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$M$2:$M$227,">"&0)>0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$N$2:$N$227,">"&0)=0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$Q$2:$Q$227,">"&0)=0),"Has value in previous day",IF(AND(COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$M$2:$M$227,">"&0)>0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$N$2:$N$227,">"&0)>0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$Q$2:$Q$227,">"&0)>0),"Has value in previous day, today and tomorrow","")))))

 

countifs.JPG

Thank you very much @OliverScheurich , I am trying now to apply it on my dataset. Will be updating you, but meanwhile what does (">"&0) means in the formula if you don't mind? 

 

'OI Finalv3'!$M$2:$M$227,">"&0)>0

 

And I tried to add the IF part at the end, it is giving me too many arguments,

 

=IF(AND(COUNTIFS('OI Finalv3'!$H$2:$H$227,H12,'OI Finalv3'!$M$2:$M$227,">"&0)>0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H12,'OI Finalv3'!$N$2:$N$227,">"&0)>0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H12,'OI Finalv3'!$Q$2:$Q$227,">"&0)=0),"OI planned in PLE and LE",IF(AND(COUNTIFS('OI Finalv3'!$H$2:$H$227,H12,'OI Finalv3'!$M$2:$M$227,">"&0)=0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H12,'OI Finalv3'!$N$2:$N$227,">"&0)>0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H12,'OI Finalv3'!$Q$2:$Q$227,">"&0)=0),"Has value in today",IF(AND(COUNTIFS('OI Finalv3'!$H$2:$H$227,H12,'OI Finalv3'!$M$2:$M$227,">"&0)=0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H12,'OI Finalv3'!$N$2:$N$227,">"&0)=0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H12,'OI Finalv3'!$Q$2:$Q$227,">"&0)>0),"Has value in tomorrow",IF(AND(COUNTIFS('OI Finalv3'!$H$2:$H$227,H12,'OI Finalv3'!$M$2:$M$227,">"&0)>0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H12,'OI Finalv3'!$N$2:$N$227,">"&0)=0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H12,'OI Finalv3'!$Q$2:$Q$227,">"&0)=0),"Has value in previous day",IF(AND(COUNTIFS('OI Finalv3'!$H$2:$H$227,H12,'OI Finalv3'!$M$2:$M$227,">"&0)>0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H12,'OI Finalv3'!$N$2:$N$227,">"&0)>0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H12,'OI Finalv3'!$Q$2:$Q$227,">"&0)>0),"Has value in previous day, today and tomorrow","")))),IF(LEFT('NS Finalv3'!H2,3)="xxx","Not Found1","Not Found"))

@abukapsoun 

The formula will look utterly alien to you but it is the way I work all the time and gradually ones thought processes get used to it.  First and foremost though, it needs Excel 365 (or 2021).

 

365 started to diverge from traditional Excel practice at the end of 2018 when array formulas became the default rather than having to use Ctrl/Shift/Enter to override the changes made during grid-based calculation to restrict the calculation to a scalar value.  In 2020, LET introduced named variables within a formula and soon after that LAMBDA allowed one to pass arguments to a formula.  This opens up the way to completely different ways of working, though most choose to stick pretty close to what they know.

 

As for my formula, the worksheet formula

 

= MAP(pointer, IdentTimingλ)

 

passes terms of 'pointer', {"X1";"X2"; "X3"; "X4"; "X5";} to the Lambda function 'IdentTimingλ' (identify time periods) one at a time and collects the results as an array.

As for the content of the Lambda function

 

= LET(
    row, XLOOKUP(ptr, tablePtr, table, 0),
    hdr, FILTER(timing, row > 0, ""),
    IF(@hdr <> "", "Has value in " & TEXTJOIN(", ", , hdr), "Not found")
  )

 

the first line uses XLOOKUP to return the row of your table that corresponds to a particular value of the pointer, "X1" (say).  FILTER looks for positive numbers in the row and uses that as a criterion to return a subset of {"previous day", "today", "tomorrow"} from the header, as an array. The final row concatenates the result array into something close to the text you specified.

 

The Lambda function itself may be viewed within Name Manager or by downloading the AFE (advanced formula editor).  If you have 365, you could just use the formula without understanding it but, most likely, it would be better to sort what you are doing now and explore the new methods when you have the time and inclination to do so.

 

@abukapsoun 

COUNTIFS('OI Finalv3'!$H$2:$H$227,H12,'OI Finalv3'!$M$2:$M$227,">"&0)

Within the COUNTIFS this means that the value in range M2:M227 is counted if it's greater than 0.

In the sample file the result of the formula for pointer x5 for the previous day is therefore 1.

 

This is how we can add the additional IF statement in case the pointer is missing in the other sheet and if it starts with "xxx".

 

=IF(AND(COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$M$2:$M$227,">"&0)>0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$N$2:$N$227,">"&0)>0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$Q$2:$Q$227,">"&0)=0),"Has value in previous and today",IF(AND(COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$M$2:$M$227,">"&0)=0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$N$2:$N$227,">"&0)>0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$Q$2:$Q$227,">"&0)=0),"Has value in today",IF(AND(COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$M$2:$M$227,">"&0)=0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$N$2:$N$227,">"&0)=0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$Q$2:$Q$227,">"&0)>0),"Has value in tomorrow",IF(AND(COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$M$2:$M$227,">"&0)>0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$N$2:$N$227,">"&0)=0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$Q$2:$Q$227,">"&0)=0),"Has value in previous day",IF(AND(COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$M$2:$M$227,">"&0)>0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$N$2:$N$227,">"&0)>0,COUNTIFS('OI Finalv3'!$H$2:$H$227,H2,'OI Finalv3'!$Q$2:$Q$227,">"&0)>0),"Has value in previous day, today and tomorrow",IF(AND(ISNA(MATCH(H2,'OI Finalv3'!$H$2:$H$227,0)),LEFT('NS Finalv3'!H2,3)="xxx"),"Not Found1","Not Found"))))))

 

countifs additional criteria.JPG

Thank you, thank you, thank you, thank you.. it seems all working as expected now!! @OliverScheurich I will dry run the data on my bigger dataset and get back to you in case needed (I hope not :) ) 

Thank you @Peter Bartholomew, Yes I have O365 and I am interested to look into that new area. But one thing, When I opened you earlier excel sheet, I could only find that piece of code "= _xlfn.MAP(pointer, IdentTimingλ)", I am not able to find where you have inserted the LET function 

@abukapsoun 

The formula

= MAP(pointer, IdentTimingλ)

is in cell C4 of Sheet1.  It looks as if the sheet has been opened in legacy Excel and the returned text shows that the MAP function is unknown.  Is the Lambda function itself visible within Name Manager or has that been scrambled too?

@abukapsoun 

Somewhere along the line, multiple matches to a given pointer seemed to creep in.  That would prevent me using XLOOKUP, since that will return only the first matching row.  To sum over the matching rows, I would need to change the formula to

=LET(
    row, BYCOL(FILTER(table, tablePtr=ptr, 0), Sumλ),
    hdr, FILTER(timing, row > 0, ""),
    IF(@hdr <> "", "Has value in " & TEXTJOIN(", ", , hdr), "Not found")
)

where Sumλ contains
= SUM(x)

I haven't followed the developments closely enough to know whether there are further changes to the problem specification.

@OliverScheurich 

This is your formula in the AFE.

=IF(
    AND(
        COUNTIFS(
            directReferenced!$B$2:$B$227, B2,
            directReferenced!$C$2:$C$227, ">" &
                0
        ) > 0,
        COUNTIFS(
            directReferenced!$B$2:$B$227, B2,
            directReferenced!$D$2:$D$227, ">" &
                0
        ) > 0,
        COUNTIFS(
            directReferenced!$B$2:$B$227, B2,
            directReferenced!$E$2:$E$227, ">" &
                0
        ) = 0
    ),
    "Has value in previous and today",
    IF(
        AND(
            COUNTIFS(
                directReferenced!$B$2:$B$227, B2,
                directReferenced!$C$2:$C$227, ">" &
                    0
            ) = 0,
            COUNTIFS(
                directReferenced!$B$2:$B$227, B2,
                directReferenced!$D$2:$D$227, ">" &
                    0
            ) > 0,
            COUNTIFS(
                directReferenced!$B$2:$B$227, B2,
                directReferenced!$E$2:$E$227, ">" &
                    0
            ) = 0
        ),
        "Has value in today",
        IF(
            AND(
                COUNTIFS(
                    directReferenced!$B$2:$B$227, B2,
                    directReferenced!$C$2:$C$227, ">" &
                        0
                ) = 0,
                COUNTIFS(
                    directReferenced!$B$2:$B$227, B2,
                    directReferenced!$D$2:$D$227, ">" &
                        0
                ) = 0,
                COUNTIFS(
                    directReferenced!$B$2:$B$227, B2,
                    directReferenced!$E$2:$E$227, ">" &
                        0
                ) > 0
            ),
            "Has value in tomorrow",
            IF(
                AND(
                    COUNTIFS(
                        directReferenced!$B$2:$B$227, B2,
                        directReferenced!$C$2:$C$227, ">" &
                            0
                    ) > 0,
                    COUNTIFS(
                        directReferenced!$B$2:$B$227, B2,
                        directReferenced!$D$2:$D$227, ">" &
                            0
                    ) = 0,
                    COUNTIFS(
                        directReferenced!$B$2:$B$227, B2,
                        directReferenced!$E$2:$E$227, ">" &
                            0
                    ) = 0
                ),
                "Has value in previous day",
                IF(
                    AND(
                        COUNTIFS(
                            directReferenced!$B$2:$B$227, B2,
                            directReferenced!$C$2:$C$227, ">" &
                                0
                        ) > 0,
                        COUNTIFS(
                            directReferenced!$B$2:$B$227, B2,
                            directReferenced!$D$2:$D$227, ">" &
                                0
                        ) > 0,
                        COUNTIFS(
                            directReferenced!$B$2:$B$227, B2,
                            directReferenced!$E$2:$E$227, ">" &
                                0
                        ) > 0
                    ),
                    "Has value in previous day, today and tomorrow",
                    ""
                )
            )
        )
    )
)=IF(
    AND(
        COUNTIFS(
            directReferenced!$B$2:$B$227, B2,
            directReferenced!$C$2:$C$227, ">" &
                0
        ) > 0,
        COUNTIFS(
            directReferenced!$B$2:$B$227, B2,
            directReferenced!$D$2:$D$227, ">" &
                0
        ) > 0,
        COUNTIFS(
            directReferenced!$B$2:$B$227, B2,
            directReferenced!$E$2:$E$227, ">" &
                0
        ) = 0
    ),
    "Has value in previous and today",
    IF(
        AND(
            COUNTIFS(
                directReferenced!$B$2:$B$227, B2,
                directReferenced!$C$2:$C$227, ">" &
                    0
            ) = 0,
            COUNTIFS(
                directReferenced!$B$2:$B$227, B2,
                directReferenced!$D$2:$D$227, ">" &
                    0
            ) > 0,
            COUNTIFS(
                directReferenced!$B$2:$B$227, B2,
                directReferenced!$E$2:$E$227, ">" &
                    0
            ) = 0
        ),
        "Has value in today",
        IF(
            AND(
                COUNTIFS(
                    directReferenced!$B$2:$B$227, B2,
                    directReferenced!$C$2:$C$227, ">" &
                        0
                ) = 0,
                COUNTIFS(
                    directReferenced!$B$2:$B$227, B2,
                    directReferenced!$D$2:$D$227, ">" &
                        0
                ) = 0,
                COUNTIFS(
                    directReferenced!$B$2:$B$227, B2,
                    directReferenced!$E$2:$E$227, ">" &
                        0
                ) > 0
            ),
            "Has value in tomorrow",
            IF(
                AND(
                    COUNTIFS(
                        directReferenced!$B$2:$B$227, B2,
                        directReferenced!$C$2:$C$227, ">" &
                            0
                    ) > 0,
                    COUNTIFS(
                        directReferenced!$B$2:$B$227, B2,
                        directReferenced!$D$2:$D$227, ">" &
                            0
                    ) = 0,
                    COUNTIFS(
                        directReferenced!$B$2:$B$227, B2,
                        directReferenced!$E$2:$E$227, ">" &
                            0
                    ) = 0
                ),
                "Has value in previous day",
                IF(
                    AND(
                        COUNTIFS(
                            directReferenced!$B$2:$B$227, B2,
                            directReferenced!$C$2:$C$227, ">" &
                                0
                        ) > 0,
                        COUNTIFS(
                            directReferenced!$B$2:$B$227, B2,
                            directReferenced!$D$2:$D$227, ">" &
                                0
                        ) > 0,
                        COUNTIFS(
                            directReferenced!$B$2:$B$227, B2,
                            directReferenced!$E$2:$E$227, ">" &
                                0
                        ) > 0
                    ),
                    "Has value in previous day, today and tomorrow",
                    ""
                )
            )
        )
    )
)=IF(
    AND(
        COUNTIFS(
            directReferenced!$B$2:$B$227, B2,
            directReferenced!$C$2:$C$227, ">" &
                0
        ) > 0,
        COUNTIFS(
            directReferenced!$B$2:$B$227, B2,
            directReferenced!$D$2:$D$227, ">" &
                0
        ) > 0,
        COUNTIFS(
            directReferenced!$B$2:$B$227, B2,
            directReferenced!$E$2:$E$227, ">" &
                0
        ) = 0
    ),
    "Has value in previous and today",
    IF(
        AND(
            COUNTIFS(
                directReferenced!$B$2:$B$227, B2,
                directReferenced!$C$2:$C$227, ">" &
                    0
            ) = 0,
            COUNTIFS(
                directReferenced!$B$2:$B$227, B2,
                directReferenced!$D$2:$D$227, ">" &
                    0
            ) > 0,
            COUNTIFS(
                directReferenced!$B$2:$B$227, B2,
                directReferenced!$E$2:$E$227, ">" &
                    0
            ) = 0
        ),
        "Has value in today",
        IF(
            AND(
                COUNTIFS(
                    directReferenced!$B$2:$B$227, B2,
                    directReferenced!$C$2:$C$227, ">" &
                        0
                ) = 0,
                COUNTIFS(
                    directReferenced!$B$2:$B$227, B2,
                    directReferenced!$D$2:$D$227, ">" &
                        0
                ) = 0,
                COUNTIFS(
                    directReferenced!$B$2:$B$227, B2,
                    directReferenced!$E$2:$E$227, ">" &
                        0
                ) > 0
            ),
            "Has value in tomorrow",
            IF(
                AND(
                    COUNTIFS(
                        directReferenced!$B$2:$B$227, B2,
                        directReferenced!$C$2:$C$227, ">" &
                            0
                    ) > 0,
                    COUNTIFS(
                        directReferenced!$B$2:$B$227, B2,
                        directReferenced!$D$2:$D$227, ">" &
                            0
                    ) = 0,
                    COUNTIFS(
                        directReferenced!$B$2:$B$227, B2,
                        directReferenced!$E$2:$E$227, ">" &
                            0
                    ) = 0
                ),
                "Has value in previous day",
                IF(
                    AND(
                        COUNTIFS(
                            directReferenced!$B$2:$B$227, B2,
                            directReferenced!$C$2:$C$227, ">" &
                                0
                        ) > 0,
                        COUNTIFS(
                            directReferenced!$B$2:$B$227, B2,
                            directReferenced!$D$2:$D$227, ">" &
                                0
                        ) > 0,
                        COUNTIFS(
                            directReferenced!$B$2:$B$227, B2,
                            directReferenced!$E$2:$E$227, ">" &
                                0
                        ) > 0
                    ),
                    "Has value in previous day, today and tomorrow",
                    ""
                )
            )
        )
    )
)=IF(
    AND(
        COUNTIFS(
            directReferenced!$B$2:$B$227, B2,
            directReferenced!$C$2:$C$227, ">" &
                0
        ) > 0,
        COUNTIFS(
            directReferenced!$B$2:$B$227, B2,
            directReferenced!$D$2:$D$227, ">" &
                0
        ) > 0,
        COUNTIFS(
            directReferenced!$B$2:$B$227, B2,
            directReferenced!$E$2:$E$227, ">" &
                0
        ) = 0
    ),
    "Has value in previous and today",
    IF(
        AND(
            COUNTIFS(
                directReferenced!$B$2:$B$227, B2,
                directReferenced!$C$2:$C$227, ">" &
                    0
            ) = 0,
            COUNTIFS(
                directReferenced!$B$2:$B$227, B2,
                directReferenced!$D$2:$D$227, ">" &
                    0
            ) > 0,
            COUNTIFS(
                directReferenced!$B$2:$B$227, B2,
                directReferenced!$E$2:$E$227, ">" &
                    0
            ) = 0
        ),
        "Has value in today",
        IF(
            AND(
                COUNTIFS(
                    directReferenced!$B$2:$B$227, B2,
                    directReferenced!$C$2:$C$227, ">" &
                        0
                ) = 0,
                COUNTIFS(
                    directReferenced!$B$2:$B$227, B2,
                    directReferenced!$D$2:$D$227, ">" &
                        0
                ) = 0,
                COUNTIFS(
                    directReferenced!$B$2:$B$227, B2,
                    directReferenced!$E$2:$E$227, ">" &
                        0
                ) > 0
            ),
            "Has value in tomorrow",
            IF(
                AND(
                    COUNTIFS(
                        directReferenced!$B$2:$B$227, B2,
                        directReferenced!$C$2:$C$227, ">" &
                            0
                    ) > 0,
                    COUNTIFS(
                        directReferenced!$B$2:$B$227, B2,
                        directReferenced!$D$2:$D$227, ">" &
                            0
                    ) = 0,
                    COUNTIFS(
                        directReferenced!$B$2:$B$227, B2,
                        directReferenced!$E$2:$E$227, ">" &
                            0
                    ) = 0
                ),
                "Has value in previous day",
                IF(
                    AND(
                        COUNTIFS(
                            directReferenced!$B$2:$B$227, B2,
                            directReferenced!$C$2:$C$227, ">" &
                                0
                        ) > 0,
                        COUNTIFS(
                            directReferenced!$B$2:$B$227, B2,
                            directReferenced!$D$2:$D$227, ">" &
                                0
                        ) > 0,
                        COUNTIFS(
                            directReferenced!$B$2:$B$227, B2,
                            directReferenced!$E$2:$E$227, ">" &
                                0
                        ) > 0
                    ),
                    "Has value in previous day, today and tomorrow",
                    ""
                )
            )
        )
    )
)

A few defined names and I might even be able to see what is going on!

@OliverScheurich Need one more help please for another enhancement to my exercise. I tried to play around with the formulas we have generated but in vain. What would be the formula to use in column "Condition" to generate such result

 

Having the following: 

sheet1

countryCondition
xhas value in 2023
yhas value in 2024
whas no value
zhas value in 2023 and 2024

 

sheet2

countryyearvalue
w2023xx 
x2023xx3
y2024xx5
z2023xx1
z2024xx2

 

thanks,

@abukapsoun 

=IF(AND(SUMPRODUCT(($A$10:$A$14=A3)*ISNUMBER(SEARCH(2023,$B$10:$B$14))*$C$10:$C$14)>0,SUMPRODUCT(($A$10:$A$14=A3)*ISNUMBER(SEARCH(2024,$B$10:$B$14))*$C$10:$C$14)>0),"has value in 2023 and 2024",IF(SUMPRODUCT(($A$10:$A$14=A3)*ISNUMBER(SEARCH(2024,$B$10:$B$14))*$C$10:$C$14)>0,"has value in 2024",IF(SUMPRODUCT(($A$10:$A$14=A3)*ISNUMBER(SEARCH(2023,$B$10:$B$14))*$C$10:$C$14)>0,"has value in 2023","has no value")))

 

This formula returns the intended result in my sheet.

sumproduct multiple columns.JPG

thank you thank you thank you.. it worked. will apply it on the bigger dataset 

@OliverScheurich I have a new scenario and thought of asking you to find the formula of the below condition if you don't mind. 

 

sheet1

CountryPeriodSplit ValueCondition
xP110 
yP120if value of all y (P1+P2+P3) > sheet 2 Total value of y then split value is incorrect 
yP240 
yP320 
    

 

sheet2

CountryTotalValue
x50
y60
  
  

 

thank you again and again

@abukapsoun 

=IF(SUMPRODUCT(($A$3:$A$8=A3)*$C$3:$C$8)>INDEX($B$12:$B$14,MATCH(A3,$A$12:$A$14,0)),"Split value is incorrect","")

 

You can try this formula which returns the expected result in my understanding.

 

split value.JPG

Hi @OliverScheurich 

 

I am back :)

 

I got one more if you don't mind, and thank you in advance.

 

NameCountryResult
AAXXIf AA has XX in column country, return XX 
AAOthersIf AA has XX in column country, return XX 
BXXIf BB has XX in column country, return XX 
BOthersIf BB has XX in column country, return XX

@abukapsoun 

You are welcome to ask as many questions as you want to of course. You can as well start a new discussion for a new question.

 

With the sample data i'm unsure what you want to achieve.

Do you actually want to return "If AA has XX in column country, return XX" for both combinations of Name and Country? Or is there another intended result for AA and Others?

Thank you @OliverScheurich. I got it addressed through a powerBI DAX formula with the support of powerBI community.

 

Appreciated. Next question, I will have it posted in a new thread. :)

@abukapsoun 

I am still puzzled by your

= _xlfn.MAP(pointer, IdentTimingλ)

It seems as if you do not have access to the Lambda helper function MAP.

The LET function was simply the definition of the Lambda function 'IdentTimingλ' and is best viewed using the Advanced Formula Environment.  Hopefully the AFE will replace the formula bar in due course though there might well be howls of protest were the formula bar removed now.

 

Since named Lambda functions use defined names, the formula should also be viewable using Name Manager.  Moving to the BI environment should be unnecessary, though if you have a lot of slicing and dicing to do with linked data-tables it would make sense to do your work there.