Formula function(s) to do this? Or is it a formula at all?
First, on Sheet2 format column A as Text.
Then in B1, enter this formula
=MAX(IF($A$1:$A1<"",ROW($A$1:$A1)))
In C1, enter
=IF(ISERROR(SMALL(IF(LEFT(Sheet1!$E$1:$E$20,5)=IND EX($A:$A,$B1),ROW($A$1:$A$20),""),ROW($A1)-$B1+1)),"",
INDEX(Sheet1!$G$1:$G$20,SMALL(IF(LEFT(Sheet1!$E$1: $E$20,5)=INDEX($A:$A,$B1),ROW($A$1:$A$20),""),ROW( $A1)-$B1+1)))
In D1, enter
=IF(ISERROR(SMALL(IF(LEFT(Sheet1!$E$1:$E$20,5)=IND EX($A:$A,$B1),ROW($A$1:$A$20),""),ROW($A1)-$B1+1)),"",
INDEX(Sheet1!$M$1:$M$20,SMALL(IF(LEFT(Sheet1!$E$1: $E$20,5)=INDEX($A:$A,$B1),ROW($A$1:$A$20),""),ROW( $A1)-$B1+1)))
These are all array formulae, they should be committed with
Ctrl-Shift-Enter, not just Enter.
Excel will automatically enclose the formula in braces (curly brackets), do
not try to do this manually.
When editing the formula, it must again be array-entered.
Then just copy B1:D1 down, as soon as it runs out of itmes it returns
blanks, so you can add another GL code from thereon.
--
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
"Julia" wrote in message
...
I'm the first to admit I'm not the best Excel user, so I'm coming to you
guys
for help. Here's what I have:
Sheet 1, Column E contains a G/L number, like this: 12345-1001 or
12345-0057; the cells are formatted as text. Column G contains the
Description of that G/L number (text) and Column M contains a cost
(formatted
as Accounting w/ 2 decimal places).
Here's what I've been asked to do:
Create a formula so that the user can (on Sheet 2), type in cell A1 the
G/L
prefix, which is the first 5 digits of the G/L number (e.g., 12345) and
the
formula finds all the G/L numbers on Sheet 1 that begin with those 5
characters and copies the information from Column E (the G/L number),
Column
G (the description) and Column M (the cost).
Then, below that, the user will type in the next G/L prefix (ie, 22345)
and
the formula would find the matches and paste the data, etc.
I hope I'm explaining this clearly. I've read so many articles this
morning
trying to figure out what this formula looks like that I think I'm more
confused now than when I started. I'm using Excel 2003.
ANY help would be GREATLY appreciated!
|