Help with Formula

%3CLINGO-SUB%20id%3D%22lingo-sub-1578331%22%20slang%3D%22en-US%22%3EHelp%20with%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1578331%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3BI%20was%20wondering%20if%20I%20could%20get%20some%20help%20with%20a%20formula.%20I%20am%20creating%20a%20database%20for%20patient%20care%20and%20trying%20to%20show%20when%20patients%20have%20completed%20their%20treatment%20and%20are%20going%20back%20to%20their%20local%20hospitals.%26nbsp%3B%20I%20have%202%20queries%20-%20the%20latter%20being%20an%20expansion%20of%20the%20first.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1)%20Is%20it%20possible%20in%20Excel%20to%20create%20a%20rule%20whereby%20if%20%22Yes%22%20is%20selected%20in%20a%20specified%20column%2C%20(as%20in%20something%20has%20been%20completed)%2C%20then%20it%20will%20move%20that%20entire%20row%20of%20information%20into%20another%20sheet%3F%20e.g.%20Have%20patients%20transferred%20care%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E2)%20Is%20it%20possible%20to%20do%20the%20above%20but%20with%20more%20detail%20such%20as%2C%20if%20%22yes%22%20is%20selected%20and%20the%20patient's%20local%20site%20is%20selected%20as%20%22QVH%22%2C%20then%20that%20row%20of%20information%20will%20be%20moved%20to%20the%20sheet%20labelled%20%22QVH%22%20.%20Trying%20to%20find%20a%20way%20of%20organising%20the%20information%20and%20making%20it%20more%20accessible.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAll%20of%20the%20sites%20are%20listed%20in%20the%20sheet%20labelled%20dropdown%20menus%2C%20under%20hospital%20sites.%20I've%20attached%20how%20an%20example%20of%20the%20spreadsheet.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20advice%20or%20support%20would%20be%20hugely%20appreciated.%20I%20really%20have%20been%20struggling%20with%20Excel%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1578331%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAdmin%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1580368%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1580368%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F754774%22%20target%3D%22_blank%22%3E%40l_d18%3C%2FA%3E%26nbsp%3BRather%20than%20transferring%20data%20from%20one%20sheet%20to%20another%2C%20consider%20using%20pivot%20tables.%20In%20the%20attached%20workbook%2C%20I%20first%20transformed%20the%20master%20data%20into%20a%20structured%20table%20and%20named%20it%20%22Patients%22.%20Then%20I%20created%20a%20pivot%20table%20containing%20all%20information%20from%20that%20master%20table%20(called%20%22Patients%22)%2C%20with%20one%20filter%20for%20rows%20that%20have%20%22Yes%22%20in%20the%20Transferred%20Care%20column%20and%20another%20for%20the%20individual%20sites.%20Now%2C%20the%20neat%20thing%20with%20pivot%20tables%20is%20that%20you%20can%20create%20separate%20pivot%20tables%20(Show%20Report%20Filter%20Pages...%20under%20Options)%20for%20each%20of%20the%20sites.%20All%20will%20be%20based%20on%20the%20same%20master%20data%2C%20but%20with%20different%20filters%20applied.%20I've%20done%20that%20in%20the%20attached%20workbook%20as%20well.%20Update%20the%20master%20data%20(note%20that%20the%20table%20expands%20automatically%20if%20you%20add%20records%2C%20and%20you%20don't%20need%20to%20update%20the%20data%20source%20for%20any%20of%20the%20pivot%20tables).%20On%20the%20Data%20ribbon%2C%20press%20%22Refresh%20All%22%20and%20all%20your%20site%20tables%20will%20display%20the%20details%20for%20all%20patients%20with%20%22Yes%22%20in%20the%20transferred%20care%20column.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELet%20me%20know%20if%20this%20could%20work%20for%20you.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1580467%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1580467%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3BThank%20you%20so%20much%20for%20your%20reply%20and%20for%20your%20help%20and%20suggestion.%20This%20does%20look%20a%20bit%20complicated%20to%20me%20(I'm%20not%20great%20with%20excel)%20and%20the%20person%20who%20will%20be%20in%20charge%20of%20the%20spreadsheet%20is%20even%20less%20familiar%20with%20Excel%20than%20I%20am%2C%20hence%20I%20was%20hoping%20for%20a%20formula%20that%20would%20sort%20the%20information%20out%20for%20us%20and%20separate%20out%20across%20different%20sheets.%20Do%20you%20know%20if%20this%20would%20be%20achievable%20at%20all%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%20The%20main%20database%20list%20will%20be%20continuously%20being%20added%20to%20and%20edited%20so%20I%20would%20like%20to%20keep%20the%20spreadsheet%20looking%20as%20simple%20as%20possible.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMany%20Thanks%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELaura%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1580528%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1580528%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%20Laura%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F754774%22%20target%3D%22_blank%22%3E%40l_d18%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3EI%20too%20am%20convinced%20that%20pivot%20tables%20are%20the%20way%20to%20go.%3C%2FP%3E%3CP%3EMy%20advise%20would%20be%20to%20have%20a%20look%20at%20some%20introductury%20videos%20about%20pivot%20tables%20at%20Youtube.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dqu-AK0Hv0b4%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dqu-AK0Hv0b4%3C%2FA%3E%20for%20instance%2C%20but%20there%20are%20far%20more.%3C%2FP%3E%3CP%3EKind%20regards%3C%2FP%3E%3CP%3EHans%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1580583%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1580583%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F754774%22%20target%3D%22_blank%22%3E%40l_d18%3C%2FA%3E%26nbsp%3B....%20that's%20exactly%20what%20I%20had%20in%20mind.%20Keep%20it%20simple%20and%20easy%20to%20maintain.%20Using%20a%20structured%20table%20makes%20adding%20records%20a%20piece%20of%20cake.%20Pivot%20tables%20can%20be%20a%20bit%20overwhelming%20at%20first%2C%20but%20once%20you%20grasp%20what%20they%20can%20do%2C%20you%20probably%20will%20use%20them%20all%20the%20time.%20You%20mentioned%20that%20you%20want%20to%20%3CU%3Emove%3C%2FU%3E%20entire%20rows%20to%20other%20sheets%20if%20certain%20conditions%20are%20met.%20That%20requires%20programming%20in%20Visual%20Basic%2C%20which%20is%20much%20more%20challenging%20than%20using%20pivot%20tables.%20Your%20only%20other%20alternative%20is%20to%20manually%20copy%20rows%20from%20the%20master%20and%20paste%20them%20in%20the%20individual%20site%20sheets.%20But%20that%20is%20both%20laborious%20and%20prone%20to%20error.%20Your%20choice%2C%20though.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1580654%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1580654%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3BThank%20you%20so%20much%20for%20your%20help.%20I%20will%20do%20as%20suggested%20and%20watch%20a%20few%20clips%20to%20educate%20myself%20and%20then%20put%20this%20in%20place.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBest%20Wishes%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3El_d18%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1580657%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1580657%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F150069%22%20target%3D%22_blank%22%3E%40Hans%20Le%20Roy%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3BThank%20you%20so%20much%20for%20your%20reply.%20I%20will%20have%20a%20look%20at%20some%20videos%20and%20see%20if%20I%20can%20get%20my%20head%20around%20it.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMany%20Thanks%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1582608%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1582608%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F754774%22%20target%3D%22_blank%22%3E%40l_d18%3C%2FA%3E%26nbsp%3B%2C%20Hello%2C%20with%20just%20formulas%20also%20it%20is%20possible%20to%20export%20the%20%22Yes%22%20%26amp%3B%20%22YES%2BQVH%22%20rows%20to%20a%20separate%20sheet.%20Refer%20attached%20file%20in%20which%20you%20can%20follow%20the%20steps%20written%20in%20callouts.%3C%2FP%3E%3CP%3ESimilar%20to%20QVH%20example%2C%20i%20hope%20you%20would%20be%20able%20to%20make%20sheets%20for%20rest%20of%20the%20sites.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYes%2C%20pivot%20tables%20have%20their%20strength%20of%20robustness%20and%20elegance.%3C%2FP%3E%3CP%3EBut%20since%20you%20mentioned%2C%20so%20sharing%20this%20formula%20based%20method%20just%20as%20another%20possibility.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1582650%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1582650%22%20slang%3D%22en-US%22%3E%3CP%3Ean%20updated%20version%20is%20attached%20in%20which%20the%20%23NA%20error%20will%20not%20be%20displayed%20for%20the%20extra%20rows.%3C%2FP%3E%3CP%3E(You%20may%20want%20to%20study%20how%20these%20formulas%20work.)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1582654%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1582654%22%20slang%3D%22en-US%22%3E%3CDIV%20class%3D%22lia-message-subject-wrapper%20lia-component-subject%20lia-component-message-view-widget-subject-with-options%22%3E%3CSPAN%3Ean%20updated%20version%20is%20attached%20in%20which%20the%20%23NA%20error%20will%20not%20be%20displayed%20for%20the%20extra%20rows.%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22lia-message-body%20lia-component-message-view-widget-body%20lia-component-body-signature-highlight-escalation%20lia-component-message-view-widget-body-signature-highlight-escalation%22%3E%3CDIV%20class%3D%22lia-message-body-content%22%3E%3CP%3E(You%20may%20want%20to%20study%20how%20these%20formulas%20work.)%3C%2FP%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Hi, 

 

   I was wondering if I could get some help with a formula. I am creating a database for patient care and trying to show when patients have completed their treatment and are going back to their local hospitals.  I have 2 queries - the latter being an expansion of the first. 

 

1) Is it possible in Excel to create a rule whereby if "Yes" is selected in a specified column, (as in something has been completed), then it will move that entire row of information into another sheet? e.g. Have patients transferred care

 

2) Is it possible to do the above but with more detail such as, if "yes" is selected and the patient's local site is selected as "QVH", then that row of information will be moved to the sheet labelled "QVH" . Trying to find a way of organising the information and making it more accessible. 

 

All of the sites are listed in the sheet labelled dropdown menus, under hospital sites. I've attached how an example of the spreadsheet. 

 

Any advice or support would be hugely appreciated. I really have been struggling with Excel 

8 Replies
Highlighted

@l_d18 Rather than transferring data from one sheet to another, consider using pivot tables. In the attached workbook, I first transformed the master data into a structured table and named it "Patients". Then I created a pivot table containing all information from that master table (called "Patients"), with one filter for rows that have "Yes" in the Transferred Care column and another for the individual sites. Now, the neat thing with pivot tables is that you can create separate pivot tables (Show Report Filter Pages... under Options) for each of the sites. All will be based on the same master data, but with different filters applied. I've done that in the attached workbook as well. Update the master data (note that the table expands automatically if you add records, and you don't need to update the data source for any of the pivot tables). On the Data ribbon, press "Refresh All" and all your site tables will display the details for all patients with "Yes" in the transferred care column.

 

Let me know if this could work for you.

Highlighted

Hi @Riny_van_Eekelen ,

 

   Thank you so much for your reply and for your help and suggestion. This does look a bit complicated to me (I'm not great with excel) and the person who will be in charge of the spreadsheet is even less familiar with Excel than I am, hence I was hoping for a formula that would sort the information out for us and separate out across different sheets. Do you know if this would be achievable at all? 

 

  The main database list will be continuously being added to and edited so I would like to keep the spreadsheet looking as simple as possible. 

 

Many Thanks, 

 

Laura

Highlighted

 

Hi Laura @l_d18 ,

I too am convinced that pivot tables are the way to go.

My advise would be to have a look at some introductury videos about pivot tables at Youtube.

https://www.youtube.com/watch?v=qu-AK0Hv0b4 for instance, but there are far more.

Kind regards

Hans

Here is the sample file: https://www.codybaldwin.com/sample-file-pivot. Interested in learning more. You can use the following link to enroll in my course, "...
Highlighted

@l_d18 .... that's exactly what I had in mind. Keep it simple and easy to maintain. Using a structured table makes adding records a piece of cake. Pivot tables can be a bit overwhelming at first, but once you grasp what they can do, you probably will use them all the time. You mentioned that you want to move entire rows to other sheets if certain conditions are met. That requires programming in Visual Basic, which is much more challenging than using pivot tables. Your only other alternative is to manually copy rows from the master and paste them in the individual site sheets. But that is both laborious and prone to error. Your choice, though.

 

Highlighted

Hi @Riny_van_Eekelen 

 

   Thank you so much for your help. I will do as suggested and watch a few clips to educate myself and then put this in place. 

 

Best Wishes, 

 

l_d18

Highlighted

Hi @Hans Le Roy 

 

   Thank you so much for your reply. I will have a look at some videos and see if I can get my head around it. 

 

Many Thanks 

Highlighted

@l_d18 , Hello, with just formulas also it is possible to export the "Yes" & "YES+QVH" rows to a separate sheet. Refer attached file in which you can follow the steps written in callouts.

Similar to QVH example, i hope you would be able to make sheets for rest of the sites.

 

Yes, pivot tables have their strength of robustness and elegance.

But since you mentioned, so sharing this formula based method just as another possibility.

Highlighted
an updated version is attached in which the #NA error will not be displayed for the extra rows.

(You may want to study how these formulas work.)