If I have the following general excel columns, how could a create a program or loop in which I can generate what I have in column A and Column B as lists. "i" represents row number so that for instance in Column A and row 3 I will have 0+0.001 (0.001=step size) and in row 4 of the same column I would have what I got in row 3 plus step size and so on. The same goes for Column B, but notice that in this case "q" changes, so I would like to generate the column B for each q as well.

I think this is pretty much a very easy standard question but I am fairly new to mathematica and I would appreciate your help.

Edit: Please also notice that I do not want to import the values of column A and B but rather have a code that calculates them.

• Check Import and give an option "Table". Apr 28 '20 at 18:21
• Thank you!. I am aware of both functions. My problem is not doing the import. What I want is to have a code that can get what I have in both columns (not to import them) by means of a loop or something like that. In other words, I want to have the same numbers I have in those columns but generate them myself with a code having both A and B columns as lists
– John
Apr 28 '20 at 18:28
• Column B isn't well defined, Cell B2 is a scalar, cell B3 is a list,.... What is the meaning of "q *(i row,columnA)" . It might help if you would examplary show the content of the first cells B3, B4,... Apr 28 '20 at 19:15
• Ulrich Column B starts with the value 90 and then row 3 would be 90+number+q, where number is 3 and q is a list with the first value being 0.1. In row 3, it would be what I got in row 3 plus number-q. I hope that helps clarify it.
– John
Apr 28 '20 at 19:27
• Again my question: For every value of q, say qi, you want an individual column B[qi]? Apr 28 '20 at 19:46

Try recursive function RSolveValue

colA = RSolveValue[{a[n] == a[n - 1] + stepsize, a[0] == 0}, a, n];
colA[Range[0, 100]]
(*{0., 0.001, 0.002, 0.003,.., 0.1}*)


Same for column B:

colB[qi_] :=RSolveValue[{b[n] == b[n - 1] + number - qi , b[0] == 90}, b, n];
colB[.1][Range[0, 100]] (* q=0.1 *)

• Thank you very much Ulrich!. This is great. One quick question. If I want to multiply qi by the i element of column A, how could I do that in this code?.
– John
Apr 28 '20 at 20:24
• Perhaps qi n stepsize Apr 28 '20 at 21:07
• That does not seem to work. I want to multiply say the qi that I get from row 2 by the number I get in Column A and row 2, qi of row 3 by the number I get in Column A and row 3 and so on....I am not sure how to do this part as well.
– John
Apr 28 '20 at 21:12
• I guess this could be similar to having something like as an exmaple: variable={5,6,7,8,9,40,30,80..etc.} and simply multiply each row of qi by each element of variable. Is it possible to have a list with elements that can be obtain for each iteration in this code?
– John
Apr 28 '20 at 21:46