Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to loop in excel without VBA or macros?

Is it possible to iterate (loop) a group of rows in Excel without VBA or macros installed? A web search didn't yield anything helpful.

=IF('testsheet'!$C$1 <= 99,'testsheet'!$A$1,"") & IF('testsheet'!$C$2 <= 99, 'testsheet'!$A$2,"") & IF('testsheet'!$C$3 <= 99, 'testsheet'!$A$3,"") & ... and so on through !$C$40, !$A$40 ... 

As it is, I'll have to repeat the above code 40 times in each cell and I have over 200 cells which need the code.

I'm pretty good with PHP/SQL, but just learning Excel.

like image 546
Jeff Avatar asked Feb 08 '11 23:02

Jeff


People also ask

Can you create a loop in Excel?

In the Mapper, select the fields that you want to include in the loop, starting with the row for the first screen that contains the fields, and ending with the row for the last field. Click Create Loop.

How do I do a while loop in Excel?

The Microsoft Excel WHILE... WEND statement is used to create a WHILE loop in VBA. You use a WHILE loop when you are not sure how many times you want to execute the VBA code within the loop body. With a WHILE loop, the loop body may not execute even once.

How do you repeat formulas in Excel?

Simply do the following: Select the cell with the formula and the adjacent cells you want to fill. Click Home > Fill, and choose either Down, Right, Up, or Left. Keyboard shortcut: You can also press Ctrl+D to fill the formula down in a column, or Ctrl+R to fill the formula to the right in a row.

Do loops do until macro?

Step 1: Create a macro name first to start the subprocedure. Step 2: Define a variable as “Long.” I have defined “x” as a long data type. Step 3: Now, enter the word “Do Until.” Step 4: After starting the loop name, enter the condition as “x =11”.


1 Answers

The way to get the results of your formula would be to start in a new sheet.

In cell A1 put the formula

=IF('testsheet'!C1 <= 99,'testsheet'!A1,"")  

Copy that cell down to row 40 In cell B1 put the formula

=A1 

In cell B2 put the formula

=B1 & A2 

Copy that cell down to row 40.

The value you want is now in that column in row 40.

Not really the answer you want, but that is the fastest way to get things done excel wise without creating a custom formula that takes in a range and makes the calculation (which would be more fun to do).

like image 64
Nat Avatar answered Sep 27 '22 22:09

Nat