A package of macros, MATRIX, is described for use with the database functions of a spreadsheet to enable domain experts to build knowledge bases for expert systems. The MATRIX macros can be used as domain-oriented knowledge acquisition tools that are specialized in coding knowledge about diagnosis of faults in analytical instrument based on case histories. These knowledge acquisition tools do not require formulation of any certainty factors to resolve conflicts and enable experts in analytical chemistry to develop diagnostic systems without the direct help of a knowledge engineer. A knowledge domain matrix is constructed so that the knowledge can be entered by the user through a graphical interface. Using a statistical analysis method, information about the least frequency of each symptom in the domain knowledge matrix can be used to differentiate one cause from the others, ensuring that each cause is characterized sufficiently. Based on the results of the statistical analysis a rule-based knowledge base can be generated automatically for use by an inference engine. The knowledge base has been implemented in the expert system GCdiagnosis.