Lookup Function

whynot

Board Regular
Joined
Jun 27, 2009
Messages
118
Office Version
  1. 365
Platform
  1. Windows
Is it possible to write a formula to look up data in a set of columns and based on certain criteria transfer the information to another column.

Screenshots below provide detail about what i am trying to accomplish

Columns B, E, and G have dates and Columns C, D, F, and H have data that i have input

I would like to transfer data to Column K, L, and M if the dates from Column J match the dates in Column B, E, or G and the headings from row with labels (circled in red) match.

1599745680804.png


1599745716525.png


Thank you very much in advance for your help.
 

Attachments

  • 1599745381276.png
    1599745381276.png
    19.1 KB · Views: 3
  • 1599745422507.png
    1599745422507.png
    7 KB · Views: 4
  • 1599745539460.png
    1599745539460.png
    30.9 KB · Views: 2

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
try this, you may need to unmerge the column header cells to work

Book1
ABCDEFGHIJKLM
1NSAADPPAYXNSAADPPAYX
231/08/20201%31/08/20202%31/08/20200.5%31/08/20201%2%0.5%
324/08/20202%22/08/20204%24/08/20201.0%24/08/2020   
417/08/20204%17/08/20208%17/08/20202.0%17/08/20204%8%2.0%
510/08/20208%10/08/202016%11/08/20204.0%10/08/2020   
603/08/202016%01/08/202032%03/08/20208.0%03/08/2020   
727/07/202032%27/07/202064%27/07/202016.0%27/07/202032%64%16.0%
Sheet5
Cell Formulas
RangeFormula
K2:M7K2=IF(AND($J2=$B2,$J2=$E2,$J2=$G2),INDEX($A2:$I2,MATCH(K$1,$A$1:$I$1,0)),"")
 
Upvote 0
Thank you very much for the reply.

It did not work - I believe its because I need to lookup all the dates in column B, E, and G and try to match with column J. For example, the date in J2 would match with the date in B5 and the data i need is in d2. I hope that makes sense.
 
Upvote 0
ok, how about?

Book1
ABCDEFGHIJKLM
1NSAADPPAYXNSAADPPAYX
223/08/20201%21/08/20202%31/08/20201%31/08/20208%4%1%
324/08/20202%31/08/20204%24/08/20201%
417/08/20204%17/08/20208%17/08/20202%
531/08/20208%31/07/202016%11/08/20204%
603/08/202016%01/08/202032%03/08/20208%
727/07/202032%27/07/202064%27/07/202016%
Sheet7
Cell Formulas
RangeFormula
K2K2=INDEX(D:D,MATCH($J$2,B:B,0))
L2L2=INDEX(F:F,MATCH($J$2,E:E,0))
M2M2=INDEX(H:H,MATCH($J$2,G:G,0))
 
Upvote 0
Thank you so much!!! That works.

If i am not bothering - a "#NA" is displayed in columns where there are no matches. Is there a way to write the formula so the column remains blank - does not show anything.

Thank you.
 
Upvote 0
you're welcome, you can use a iferror() function like this;

=iferror(INDEX(D:D,MATCH($J$2,B:B,0)),"")
 
Upvote 0
That works!!!

Thank you very much!!!

I really appreciate the help.

Have a great day!!!
 
Upvote 0
Hello Here is another formula that you can use.
Book1
ABCDEFGHIJKLM
1QuarterMonthSANSAADPPAYXNSAADPPAYX
231-03-20117830-04-2011731-05-2011231-12-20112  
330-06-20110031-07-2011531-08-2011431-01-2012 5 
430-09-20112231-10-2011730-11-2011329-02-2012  4
531-12-20112231-01-2012529-02-2012431-03-2012   
630-04-2012   
731-05-2012   
830-06-2012   
Sheet1
Cell Formulas
RangeFormula
K2:K8K2=XLOOKUP(J2,$B$2:$B$5,$D$2:$D$5,"")
L2:L8L2=XLOOKUP(J2,$E$2:$E$5,$F$2:$F$5,"")
M2:M8M2=XLOOKUP(J2,$G$2:$G$5,$H$2:$H$5,"")
 
Upvote 0
thank you for the help!! I really appreciate it!!!
 
Upvote 0

Forum statistics

Threads
1,215,753
Messages
6,126,674
Members
449,327
Latest member
John4520

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