Last matching Value in multiple Columns

Emre06

New Member
Joined
Sep 27, 2023
Messages
19
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hello, i have 2 Columns containing guards's names. ( I tried to use "maxifs" function but it is working only for one column ) My Question is: I need formula to find "Last Date" of "John Fizz" in "Beach"?

Kitap1 (version 1).xlsb
ABCD
1DateGuard 1Guard 2Location
21.02.2023Mike RogersRomeo LoiLobby
32.02.2023John FizzTaric BenBeach
43.02.2023Alan DuskLora IanHotel
54.02.2023Clark KentJohn FizzBeach
Sayfa1
 
@BigBeachBananas Thank you very much !


Thank you very much for you kind help Sir. Sorry But Firstly cannot copy code, I think spaces are giving me problem. And G2 value and H2 value is empty I suppose ? I couldnt manage to use that :(

Excel Formula:
=MAX(FILTER(A:A,(B:B="John Fizz")*(D:D="Beach")+(C:C="John Fizz")*(D:D="Beach")))

Replace "John Fizz" and "Beach" with your cell references.
 
Upvote 1

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
@BigBeachBananas Thank you very much !


Thank you very much for you kind help Sir. Sorry But Firstly cannot copy code, I think spaces are giving me problem. And G2 value and H2 value is empty I suppose ? I couldnt manage to use that :(
1) Did you
a) click on the copy symbol in the top right corner of the grey area that contains the formula ?
b) copy the code directly into the formula bar ? (not into the cell)
2) G2 is where I had the name to be used by the formula and H2 where I had the location, you need to put in your own cell references for that.
Your example shows B3 & D3 but seems a bit unlikely since it is in the range to be searched.

BigBeachBananas has now supplied the flattened out version, I was just trying to make the formula logic more obvious by using spaces and Alt+Enter to structure the formula
 
Upvote 1
Excel Formula:
=MAX(FILTER(A:A,(B:B="John Fizz")*(D:D="Beach")+(C:C="John Fizz")*(D:D="Beach")))

Replace "John Fizz" and "Beach" with your cell references.
Thank you very much for your help, I was kind of lost; now I got it.

1) Did you
a) click on the copy symbol in the top right corner of the grey area that contains the formula ?
b) copy the code directly into the formula bar ? (not into the cell)
2) G2 is where I had the name to be used by the formula and H2 where I had the location, you need to put in your own cell references for that.
Your example shows B3 & D3 but seems a bit unlikely since it is in the range to be searched.

BigBeachBananas has now supplied the flattened out version, I was just trying to make the formula logic more obvious by using spaces and Alt+Enter to structure the formula
Thank you very much, now thanks to you without errors I have found the last dates.
 
Upvote 0
By the way is there a way to conditional format #N/A error ?
 
Upvote 0
By the way is there a way to conditional format #N/A error ?
I was going to throw that in but opted to keep it to the essentials in the first pass.
Just wrap the whole thing in an IFERROR,
So before the Max add
IFERROR(
then at the end add
,"")
Or you could but something like Not Found between the quotes.
 
Upvote 1
I was going to throw that in but opted to keep it to the essentials in the first pass.
Just wrap the whole thing in an IFERROR,
So before the Max add
IFERROR(
then at the end add
,"")
Or you could but something like Not Found between the quotes.
Thank you very much for your understanding, now very tidy page I will be working with :)
 
Upvote 0
I have one more question about same formula: I am trying to use * asterisk like "*beach*" for this table. How can I make this work ( "Last Date" of "John Fizz" in "Beach"? " )

Kitap1.xlsx
ABCD
1DateGuard 1Guard 2Location
21.02.2023Mike RogersRomeo LoiLobby
32.02.2023John FizzTaric BenBeach
43.02.2023Alan DuskLora IanHotel
54.02.2023Clark KentJohn FizzBeach,Lobby
6
7Beach
8John Fizz0
Sayfa1
Cell Formulas
RangeFormula
B8B8=MAX(FILTER(A:A,(B:B="John Fizz")*(D:D="*Beach*")+(C:C="John Fizz")*(D:D="*Beach*")))
 
Upvote 0
Try this. I have also rearranged it a little so you don't need to evaluate the location twice.

Excel Formula:
=MAX(FILTER(A:A,((B:B="John Fizz")+(C:C="John Fizz"))*ISNUMBER(SEARCH("Beach",D:D))))
 
Upvote 1
Solution
Try this. I have also rearranged it a little so you don't need to evaluate the location twice.

Excel Formula:
=MAX(FILTER(A:A,((B:B="John Fizz")+(C:C="John Fizz"))*ISNUMBER(SEARCH("Beach",D:D))))
Thank you very much Sir, you are amazing ! Do you know how can I find John Fizz has been in beach ? (2 times in this table)

I tried to change MAX with Countif but it didn't worked, Sorry.
 
Upvote 0

Forum statistics

Threads
1,215,110
Messages
6,123,149
Members
449,098
Latest member
Doanvanhieu

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