INDEX-MATCH with IF and logical AND

hurtlingturtle

New Member
Joined
Jan 28, 2019
Messages
2
Hi All,
I hope someone here can help me out. I've been searching everywhere and cannot find what I need.

To explain, I am working on a workbook that has a table within it that contains load of rows of data. This table is called TeamSheetsAll. Within that table are many columns, but relevant here are the columns [Fiscal period] and [over 1m]. Fiscal period is a text value whereas over 1m is a boolean TRUE/FALSE value. The other field that is important is the [Op ID] which is a text value to be returned.
I should also state that the A6 references are used to check an increasing list of data in my new table to ensure I do not duplicate rows.

I am trying to generate a unique list of op ids that meet the specific logical requirements of my IF statement. The formula I currently have is as follows. But this results in empty data.

=IFERROR(INDEX(IF(AND(TeamSheetsAll[Fiscal period]=CurrentFQ,TeamSheetsAll[over 1m]=TRUE),TeamSheetsAll[Op ID],""), MATCH(0,COUNTIF($A$6:A6, IF(AND(TeamSheetsAll[Fiscal period]=CurrentFQ,TeamSheetsAll[over 1m]=TRUE),TeamSheetsAll[Op ID],"")), 0)),"")

However, if I do this without the AND logic then the following formula works.

=IFERROR(INDEX(IF(TeamSheetsAll[over 1m]=TRUE,TeamSheetsAll[Cloud Op ID],""), MATCH(0,COUNTIF($A$6:A6, IF(TeamSheetsAll[over 1m]=TRUE,TeamSheetsAll[Cloud Op ID],"")), 0)),"")

Similarly if I replace this with OR logic it works also. AND does not. Just to be clear I have triple checked the data and I absolutely do have data records in the table that meet the AND criteria :)

Any advice is most welcome.
cheers
Bruce
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Welcome to Mr Excel forum

A small data sample (~10 rows) along with expected results would be helpful.

M.
 
Upvote 0
If I were you, I would just use a helper column in the data set. For example, you want TeamSheetsAll[Fiscal period]=CurrentFQ and TeamSheetsAll[over 1m]=TRUE, so create a helper column to get CurrentFQTRUE and then index and match for that combined term.

Otherwise, a sumproduct might be in order.
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,215
Members
453,024
Latest member
Wingit77

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