Lookup "TEXT" in certain "CELLS" and return the value 2 rows above the "TEXT" into another "SHEET" "CELL", Excel 2021

HKA_84

New Member
Joined
Oct 3, 2022
Messages
9
Office Version
  1. 2021
  2. 2011
  3. 2010
Platform
  1. Windows
  2. MacOS
Hello,

I'm trying to make a formula to solve my problem, if it is possible.
I tried searching many formula online but it didn't fit in the formula I want to use on my file

on SHEET 2 CELL (B12) write formula, IF(B4:H4) and (B7:H7), contains the TEXT "Billy 1" then return the value 2 rows above the answer "Billy 1" that is the Date (Shown the Date 22-Jan-22) into Sheet 1 CELL (B4).

another Cell but same question

on SHEET 2 CELL (B14) write formula, IF(B4:H4) and (B7:H7), contains the TEXT "Billy 2" then return the value 2 rows above the answer "Billy 2" that is the Date (Shown the Date 25-Jan-22) into Sheet 1 CELL (C4).

another Cell but same question different name

on SHEET 2 CELL (F12) write formula, IF(B4:H4) and (B7:H7), contains the TEXT CAPS LOCK "MARY 5" then return the value 5 rows above the answer "MARY 5" that is the Date (Shown the Date 21-Jan-22) into Sheet 1 CELL (F8).

SHEET 2
Example.xlsx
ABCDEFGH
1
221-Jan-2222-Jan-2223-Jan-2224-Jan-2225-Jan-2226-Jan-2227-Jan-22
3
4Billy 1Billy 2
5
6
7MARY 5Billy 3
8
9
10
11
12
13
14
15
Sheet2


SHEET 1
Example.xlsx
ABCDEFGH
2
3Billy 1Billy 2Billy 3Billy 4Billy 5Billy 6
4
5
6
7MARY 1MARY 2MARY 3MARY 4MARY 5MARY 6
8
9
Sheet1


I hope it can be solved using formula but if cannot. I can try to use VBA.
Thanks.
 

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.
I don't understand what B12, B14 and F12 on Sheet2 have to do with it. As best I could understand what you are wanting is this.

HKA_84.xlsm
ABCDEFG
1
2
3Billy 1Billy 2Billy 3Billy 4Billy 5Billy 6
422-Jan-2225-Jan-2224-Jan-22   
5
6
7MARY 1MARY 2MARY 3MARY 4MARY 5MARY 6
8    21-Jan-22 
Sheet1
Cell Formulas
RangeFormula
B4:G4,B8:G8B4=IF(COUNTIF(Sheet2!$B$3:$H$7,B3),MIN(IF(Sheet2!$B$3:$H$7=B3,Sheet2!$B$2:$H$2,"")),"")
 
Upvote 0
Solution
Hi Peter,

Thank you very much for your reply.
This solve one of my solution😀
 
Upvote 0
It is slightly a bit same format as this one but just Added Name in it and the Billy and Mary is replaced by PH 1 and so on
what I want to do in it is

Search for PH 1 (2022) but follow by the Name, so Example Billy or Mary can have PH 1 (2022) or PH 2 (2022) or PH 5 (2021) and return its Date value 2row above into Sheet "PUBLIC HOLIDAY", According to the Name, PH 1 and year

Thank you for the great help again..
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,206
Members
453,022
Latest member
RobertV1609

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