Validation based on selected criteria

mrMozambique

Board Regular
Joined
Mar 9, 2005
Messages
97
Hello all. I'll paste my spreadsheets first and then proceed with my question below. please note that these are actually two different sheets (one raw data set up sheet<top> and the other a data entry sheet for end users<bottom>). I put them together to avoid the java errors.
mrexcel.xls
ABCDE
1ProgramaTipodeDespesaActivityTitleValueProgram_Object
2ADMINACTIVITIESEnglish course for two - $1260/180 hour course X 2 courses$5,040ADMINACTIVITIES
3ADMINACTIVITIESBasic computer course for 10 persons - $350/person X 10 persons$3,500ADMINACTIVITIES
4ADMINACTIVITIESOtherActivities$-ADMINACTIVITIES
5ADMINCONSULTANTRedesign financial and accounting tracking system$4,975ADMINCONSULTANT
6ADMINCONSULTANTContinuation of TA Contract for NGO Contract Management (65 days X 2 consultants X $350/day)$47,775ADMINCONSULTANT
7ADMINCONSULTANTOtherConsultingADMINCONSULTANT
8ADMINEQUIPMENTDesktopComputer(TypePentiumIV)$2,000ADMINEQUIPMENT
9ADMINEQUIPMENTLaptops(TypePentiumIV)$2,500ADMINEQUIPMENT
10ADMINEQUIPMENTPrinters(TypeLaserjet2100)$500ADMINEQUIPMENT
11ADMINEQUIPMENTLCDProjector$3,400ADMINEQUIPMENT
12ADMINEQUIPMENTFlashDrive$200ADMINEQUIPMENT
13ADMINEQUIPMENTPhotocopyMachine$11,500ADMINEQUIPMENT
14ADMINEQUIPMENTSmallrefrigerator$800ADMINEQUIPMENT
15ADMINEQUIPMENTOtherEquipment$-ADMINEQUIPMENT
16ADMINOTHERAccounting Department fees/DNS ($1500/month)$18,000ADMINOTHER
17ADMINOTHERInternetserviceprovider$15,000ADMINOTHER
18ADMINOTHERDedicated leasedlinefor internet service;11,000ADMINOTHER
19ADMINOTHERInter-departmental accounting costs ($300/monthX12months)3,600ADMINOTHER
20ADMINOTHEROtherADMINOTHER
21
22ProgramaTipodeDespesaConcatenateDetalhe-DespesaAmount
23ARTCONSULTANTARTCONSULTANT$150/day consultancy to assess quality of care provided at Day Hospitals575
24BIOSAFETYEQUIPMENTBIOSAFETYEQUIPMENTAssessment of sterilization procedures and inventory of sterilization equipment - Per diems: 4 persons x $50/day x 7days257
25CMAMOTHERCMAMOTHERTechnicalClothes3,005
26ADMINOTHERADMINOTHERInternetserviceprovider1,500
27ADMINACTIVITIESADMINACTIVITIESEnglish course for two - $1260/180 hour course X 2 courses1,500
28ADMINEQUIPMENTADMINEQUIPMENTPrinters(TypeLaserjet2100)1,500
Sheet1



The top table is a budgeting tool that we use at the Mozambican Ministry of Health. We have programs (column A), expense types (column B) and expense details (column C) that are all set up at the beginning of the budgeting period. Column E is a concatenation of columns A&B that I have been hoping to use to define ranges (more on that in a minute). So, after we have established the budget and various expenses, we start spending money.

Our finance guys use the 2nd table to track these expenses. They select the program area (Column A) and expense type (column B) from dropdowns. I then have concatenated their selection in column C (hidden from the user). Based on their selections in the first two columns, I want ONLY those activities entered in column C of the top table to appear in Column D of the bottom table. In other words, a validation list dropdown with the named range from the concatenation in column C of bottom table. The validation dropdown will only include expenses that correspond to the program and expense type already selected in columns A&B. I've been able to use the Indirect function (ex. cell D23's validation = indirect(C23).

This only works now because I have manually named the ranges in the top table's column C as the corresponding name in column E. So, C2-C4 are a named range "ADMINACTIVITIES" and C5-C7 are named "ADMINCONSULTANT", etc. etc. So, when the user selects "ADMIN" in A27 and "ACTIVITIES" in B27, D27 turns into a dropdown list of manually named range "ADMINACTIVITIES" based on Indirect(C27). Again, this only works now because I've manually created the range "ADMINACTIVITIES" in the above table.

Shouldn't it be possible to use the OFFSET and COUNTIF functions together somehow to create the validation automatically without the need for manually named ranges? I'm open to other suggestions, but I need to be able to turn this tool over to my Ministry colleagues without the need to manually name ranges.

Any suggestions? I can't be the first to face this problem so I thought I'd throw it out to the puzzle-solvers here. Thanks a ton in advance!
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
In your data set up sheet sheet name column C Activities and column E Programs. In your data entry sheet in D23 you can use Data Validation, List with Source:

=INDEX(Activities,MATCH(C23,Programs,FALSE)):INDEX(Activities,MATCH(C23,Programs,FALSE)+COUNTIF(Programs,C23)-1)
 
Upvote 0
Andrew, thanks so much. I should have come here a long time ago! It works beautifully. the Ministry of Health in Mozambique sends its regards!

Cheers!
 
Upvote 0
Andrew Poulsom said:
In your data set up sheet sheet name column C Activities and column E Programs. In your data entry sheet in D23 you can use Data Validation, List with Source:

=INDEX(Activities,MATCH(C23,Programs,FALSE)):INDEX(Activities,MATCH(C23,Programs,FALSE)+COUNTIF(Programs,C23)-1)

I have been using this spreadsheet for a while now and then transferred the use of the abovementioned formula to another sheet that I'm using. I have several validated cells next to it. When I'm tabbing or arrowing through these cells, they move extremely slowly. Is it possible that this validation is causing some performance issues? It's really obnoxious to wait while the next cell is selected. I'm not even changing the cells, only selecting them.

Thanks from Mozambique.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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