# Formula to fill cells based on the date in another cell

1. ## Formula to fill cells based on the date in another cell

Hey,

I have recently created a dayfile userform where the user enters In customer information, along with the date the customer is due to be called back. This data is then stored in another sheet.

What I am trying to do is write a formula for the main tab that if the callback date equals today, every customer due that day has their details pulled through to the main tab. I've made a few attempts but not no avail.

Hope you can help!

Thanks

2. ## Re: Formula to fill cells based on the date in another cell

Even if you put the callback due date in the first column of the data sheet, using VLOOKUP() or MATCH()/INDEX() would only retrieve the first matching row and not all the rows for that date. To get all the matching rows, see:

http://office.microsoft.com/en-us/ex...001226038.aspx

3. ## Re: Formula to fill cells based on the date in another cell

You could also consider using a pivot table instead of formulas - it's much more flexible and can be reorganized on the fly for different dates, different customer layouts, etc. To create one, click anywhere in your data, then from the insert ribbon, select data table and follow the prompts.

4. ## Re: Formula to fill cells based on the date in another cell

Assuming date is stored in say A1,

=IF(\$A\$1<>TODAY(),"",IFERROR(INDEX(Sheet2!A\$2:A\$100,SMALL(IF(Sheet2!\$D\$2:\$D\$100=\$A\$1,ROW(Sheet2!\$A\$2:\$A\$100)-ROW(\$A\$2)+1),ROWS(\$A\$2:\$A2))),"")

where Sheet2 is your database sheet, and column A contains customer info, and column D contains the call back date.

adjust the sheetname and ranges to suit, (don't use too large column sizes) and then confirm with CTRL+SHIFT+ENTER not just ENTER and copy down.... you can also copy across if more info in adjacent columns

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1