Home » excel » excel – Formulas to populate spreadsheet with data

excel – Formulas to populate spreadsheet with data

Posted by: admin May 14, 2020 Leave a comment


I want to populate some cells given certain condition. The thing is, I have no idea how to do this with just formulas (can’t use macros or the sort).

Anyways, here’s my workbook, with its **sheets**:

TASK     Week
Test     1
Test2    1
Test3    1
Test4    2
Test5    3
Test6    2



What I’ve been trying to do is:

  • Populate Sheet2 tasks based on the week chosen.
  • If I choose week #2 (in Sheet2), it should populate the task list (on the same sheet) with the tasks from Sheet1 that have that week number.

For example, right now it is (hypothetically) already loading tasks with a week == 2.

Any doubt, just let me know! I hope I made my issue clear.

Thank you very much in advance!

How to&Answers:

Okay, I found a better solution. This one requires an extra helper column on Sheet2, but it at least returns a compact list of matches (no weird spacing).

On Sheet2, in the first row of your list of matches (A3 in this example) enter the following:


In the adjacent cell in the next column (B3 here) enter the following:


where 2 is the week # you are matching.

In the next row enter the following formulas (in A4 and B4 respectively):




You can fill down this row of formulas as far as you like.


Here’s the first way to do this I thought of. There are probably better, more elegant solutions, but I thought I’d share.

If you know the total number of tasks in your list on Sheet1, say n, you can do the following:

  1. On Sheet 2 where you want your list of matching tasks, select from A4 (or whatever you want the top of your list to be) down to A(4+n-1). So for your sample data, select A4:A10
  2. Without changing the selection, type the following formula:


    where 2 is the week # you want to match.

  3. Enter the formula by pressing Ctrl+Shift+Enter.