Search Columns for a Value and Copy Cell Data from Same Row

1z3

New Member
Joined
Mar 25, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello, I hope I can ask in a way that makes sense. I am a case manager at a medical facility and one of the tasks I perform is ensuring certain notes are signed by physicians within 72 hours following a patient discharge. To keep track, I want to create a sheet that reviews my primary sheet for a discharge date, and then copy the patients name. Here is how much sheet headings look:

Last Name (A) | First Name (B)| Admit Date (C) | Last Review (D) | Next Review (E) | Notes (F) | CM (G) | Insurance (H) | Discharge Date (I)

On my second sheet, my heading is:

Last Name (A) | First Name (B) | Date Report Needed (C) |

For the second sheet, I'm looking to have all these columns filled automatically by searching my primary worksheet for a Discharge Date (I). If a discharge date exists (I), then the last name and first name will be entered on my second worksheet and the date report needed (C) will be the corresponding discharge date (I) + 3. I have tried a few different ways to get this to work, but usually run into a spill error or the data from other rows is being pulled. Any help is greatly appreciated!
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Sorry to double post, I didn't see an edit button. An update to my current approach - I'm new to Excel and I'm not sure how to go about it. But I added a new column which states "Set" if a discharge has been set. I am using XLOOKUP to find "Set" and if it exists I'll pull the patient information. The problem I have is determining if the patient that is being pulled has already been pulled over to my second sheet. As a result, I'll end up with the same patient being copied over.

To find patients with DC set:
=XLOOKUP("Set",Skilled!M10:M54,Skilled!A10:A54)

To find if the patient has already been pulled I was thinking about comparing my current patient list with the list that is being searched in my other sheet. I don't think this is the appropriate way to do so, and I'm not quite sure how to complete the function if it were the correct way...

=XLOOKUP(A2:A300, XLOOKUP("Set",Skilled!M10:M54,Skilled!A10:A54), return_true (means we already pulled this patient, need to create a loop function to continue searching), return_false (would mean we didn't pull patient data over and I should pull this data))

Sorry if none of this makes sense, I'm new to excel. I'm assuming for this to work I'll need to create a loop that searches through the array for existing client names, and to continue the search if the name already exists within that array. I've looked up INDEX function, but not quite sure how to make it work for this problem.
 
Upvote 0

Forum statistics

Threads
1,214,515
Messages
6,119,973
Members
448,933
Latest member
Bluedbw

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