Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8367747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:14:12+00:00 2026-06-09T13:14:12+00:00

Here I am once again, asking for help on this great community. I hope

  • 0

Snapshot

Here I am once again, asking for help on this great community.
I hope I can retribute as much as you did someday.

The 4th column (D) in the picture is the expected output.

This is how I put the problem:

  • If a number is negative / or has an A (number in the A row is always negative);

    • Use MATCH to check if there is a correspondent (positive) number in the range (between headers);

    • If there is a MATCH output the value of the ID (1st column) of the F that has been matched, and then, output the ID of the A that has been matched

  • If not, do nothing or place a 0.

The problems are:

  • It needs to loop, because the negative value can come after the positive one;

  • The search must be contained between headers.

I’ve tried to modify and create my own solutions from the tips and codes of the other questions I’ve placed, but with no success..

Thank you so much!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T13:14:13+00:00Added an answer on June 9, 2026 at 1:14 pm

    Try pasting this into the immediate window of the VBE and hitting enter:

    Names.Add "i", "=$A$1:$A$12": _
    Names.Add "v", "=$B$1:$B$12": _
    Names.Add "m", "=$D$1:$D$12": _
    Names.Add "h", [IF({1},LOOKUP(ROW(i),ROW(i)/(v=INDEX(v,1))))]: _
    Names.Add "l", [IF({1},LOOKUP(ROW(i),ROW(i)/(v=INDEX(v,1)),FREQUENCY(-ROW(i),IF(v=INDEX(v,1),-ROW(i),0))-1))]: _
    [m]=[IF(COUNTIF(OFFSET(v,h,,l),"=-"&v),CONCATENATE("=",ADDRESS(ROW(i),COLUMN(i),4),"&"" AND ""&INDEX(",ADDRESS(h+1,COLUMN(i)),":",ADDRESS(h+l,COLUMN(i)),",MATCH(-",ADDRESS(ROW(v),COLUMN(v),4),",",ADDRESS(h+1,COLUMN(v)),":",ADDRESS(h+l,COLUMN(v)),",0))"),"")]: _
    Names("h").Delete: _
    Names("l").Delete
    

    The output for the example data in the question is:

    D5  =A5&" AND "&INDEX($A$2:$A$6,MATCH(-B5,$B$2:$B$6,0))
    D11 =A11&" AND "&INDEX($A$11:$A$12,MATCH(-B11,$B$11:$B$12,0))
    

    Note: This method uses named arrays to store intermediate results for header positions h and section lengths l and takes around 3-4 secs when the range names i (id), v (value) and m (match) are extended to 40,000 rows. A simpler formula for this is possible but it would be very inefficient to fill down on large data sets.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I received some great help here the other day and hope once again I
Once again I'm asking this question, and still can't find any reasonable solution. I
Once again, I need some help and I appreciate you all for being here
So once again I need some help with this program for class. Maybe its
Once again I need some much appreciated help from the experts :) I am
Once again, thank you for the great help so far. The source code: int
I am once again very confused and I return here for more help If
Hello pros I come here once again for help with php programming. I am
The unique poll/vote/survey i mean here is, user can only vote once. How do
I'm asking you for help, because I can't understand what I'm doing wrong. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.