Can I auto fill cells based on text in other cells with numerous variables?

I am wanting automatically fill cell C with a code depending on the number in cell one (1,2, or 3) and the letter in cell H (D or N). The answer could be 6 different variables. How do I do that? Then I need a second auto fill for cell G, if E is a number (1-3), F is a number (1-3), and H is a letter (D or N), enter this amount of money, which has 18 variables. Can I do this in LibreOffice?

You seem to ask a question about calc but taggged your question base, which is reserved for questions related to the database module of LibreOffice, which is called Base. Please correct either the tag or my assumption.

Hello,

of course you can to that - the following formula assumes that

  • Cell A1 contains any of the number {1,2,3}
  • Cell H1 contains any of the characters {D,N}

=IFS(AND(A1=1;H1="D");"1-D";AND(A1=2;H1="D");"2-D";AND(A1=2;H1="D");"3-D";AND(A1=1;H1="N");"1-N";AND(A1=2;H1="N");"2-N";AND(A1=2;H1="N");"3-N";OR(A1="";H1="");"No valid selection")

"1-D": to be replaced with the answer for this combination
"2-D": to be replaced with the answer for this combination
"3-D": to be replaced with the answer for this combination

"1-N": to be replaced with the answer for this combination
"2-N": to be replaced with the answer for this combination
"3-N": to be replaced with the answer for this combination

Now it’s an easy exercise to extend to the 18 combinations of your second task.

Hope that helps.

If the answer helped to solve your problem, please click the check mark (:heavy_check_mark:) next to the answer.

Good joke. Funny. A little cruel, but funny

Your first task (with two data sets) is solved simply - use the array formula

{=A1:A3&"-"&TRANSPOSE(H1:H2)}

All Combinations 2 Set.gif

To get a solution for three data sets, follow this procedure for two data sets from columns E and F, and then repeat the formula for each column from the resulting set and for data from cells in H column

For example, put to E17 formula

{=E1:E3&"-"&TRANSPOSE(F1:F3)}

It fill range E17:G19

Step1

Now put formulas for each column of this range:

Step2