#VALUE error when using AGGREGATE to find the last of multiple last instances of characters

MESTRAAL

New Member
Joined
Oct 7, 2020
Messages
3
Office Version
  1. 365
Platform
  1. Windows
As part of a larger INDEX/MATCH formula, I am trying to extract text in a string after the last instances of commas or equal signs (whichever comes later in the string). I have so far been attempting to use the AGGREGATE function as it can handle errors for cells where one of these don't appear and evaluate the returned FIND values together, rather than using a series of nested arguments. When I use helper cells with

=FIND("@",SUBSTITUTE(D373,",","@",LEN(D373)-LEN(SUBSTITUTE(D373,",",""))),1)

and then AGGREGATE in a different cell, it works perfectly. However, why I try to nest the formulas to get rid of the helper cells using

=AGGREGATE(4,6,(FIND("@",SUBSTITUTE(D373,",","@",LEN(D373)-LEN(SUBSTITUTE(D373,",",""))),1)),(FIND("@",SUBSTITUTE(D373,"=","@",LEN(D373)-LEN(SUBSTITUTE(D373,"=",""))),1)))

I get a #VALUE error, apparently because AGGREGATE can no longer ignore the error returned by one of the FIND functions. Is there a way I can fix this or should I try another function altogether?
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Do you have the LET function yet?
 
Upvote 0
Forget that, it doesn't make much difference.
How about
Excel Formula:
=FIND("@",SUBSTITUTE(SUBSTITUTE(D373,"=",","),",","@",LEN(D373)-LEN(SUBSTITUTE(SUBSTITUTE(D373,"=",","),",",""))))
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,517
Members
449,088
Latest member
RandomExceller01

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