Basic Array/Sorting Question

bpiermat

New Member
Joined
Aug 8, 2019
Messages
2
I try to keep my formulas as simple as possible. Here is my current formula for finding a match in two columns:

{=SUM(IF(F$24:F$43=F44,$D$24:$D$43))}

The issue with this is that it sums instead of just reporting the value. Which is a problem if the results are not numerical.

I tried this:

{(F$24:F$43=F44)*$D$24:$D$43)}

But this returns an array of zeros and my match....so it is close to what I want. But I need a VBA function or other simple method to take this large array and just return the single none zero number

Thanks!
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Welcome to the Board.

If there's only one match, how about:

=IFERROR(INDEX($D$24:$D$43,MATCH(F44,F$24:F$43,0)),"No match")
 
Upvote 0
Welcome to the Board.

If there's only one match, how about:

=IFERROR(INDEX($D$24:$D$43,MATCH(F44,F$24:F$43,0)),"No match")


Eric,

Thanks for this solution, yes, this will work. I was trying to write this function in a way that does not involve the overhead of a lookup function.
 
Upvote 0
I'd have to do some timings, but I suspect a lookup function would be faster than an array formula. Come back and let us know if your sheet becomes too slow and perhaps we can figure something else out.
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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