need some help

bam12

Well-known Member
Joined
Dec 6, 2004
Messages
985
need some help on this

in column e a cell will contain either a "P" or "V" if it is a "P" i would like it to take the contents of column a and b in same row as the cell with "P" in it and move the contents of column cells A and B to I and J and continue this moving down a row each time it find cell in column e with a p

comma below is column break

example
a7 is the date field
1/23/06,8,,V,,,,,
2/3/06,8,,P,,,2/3/06,8 problem being this will actually start on I7 and j7
and each time it find a p will be the next line down so when it finds next p it will put that in I8 and J8


Thnaks in advance for any help
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
bam12

This is not entirely clear to me so a few questions:
1. Can you confirm that columns I and J will not have blank rows in its data?
2. Will the values be deleted from columns A and B when moved to columns I & J?

Is this the sort of thing you want to end up with?
Mr Excel.xls
ABCDEFGHIJK
6
705/08/20068P05/08/20068
810/08/20066P10/08/20066
915/08/20065V20/08/20068
1020/08/20068P04/09/20069
1125/08/20066V
1230/08/20064V
1304/09/20069P
1409/09/20066V
15
Move Data
 
Upvote 0
yes

yes column I and J will have no data or formulas in them

No the info has to stay in column A ND B as well

And yes that is exactly how i want it ot look

thanks
 
Upvote 0
add

column A and B will also be added to at times, so when this happens the new lines will be added to I and J
 
Upvote 0
bam12

I'm sort of feeling that a VBA approach might be good here. However, as that is not my strong point here is an attempt at a formula approach.

1. I've entered the letter of interest in I6.
2. Formula in I7 (copied across and down): =IF(ROWS(I$7:I7)>COUNTIF($E$7:$E$16,$I$6),"",INDEX(A$7:A$16,SUMPRODUCT(SMALL(--($E$7:$E$16=$I$6)*(ROW(A$7:A$16)-ROW(I$6)),COUNTIF($E$7:$E$16,"<>"&$I$6)+ROWS(I$7:I7)))))
3. You may need to format column I as Date and column J as General or Number
Mr Excel.xls
ABCDEFGHIJK
6P
705/08/20068P05/08/20068
810/08/20066P10/08/20066
915/08/20065V20/08/20068
1020/08/20068P04/09/20069
1125/08/20066V  
1230/08/20064V  
1304/09/20069P  
1409/09/20066V  
15  
Move Data
 
Upvote 0
thanks

Peter

Thanks it works like a dream.....just wish i knew a little more about formulas so i would have to always ask for help

but i am learning
 
Upvote 0
small problem

i have this formula in another cell that is checking column I, and now it is not working right, is this because of the formula in that column


=SUMPRODUCT((I$7:I$33>TODAY()-90)*1)

what this does is keep track of numbers of days that are less then 90 before todays date
 
Upvote 0
bam12

See if this works for you:
=COUNTIF(I$7:I$33,">"&TODAY()-90)
 
Upvote 0
describe

could someone explain to me , Peters formula.. i am just trying to figure out how it works

this i formula is it also back in prior messages

=IF(ROWS(I$7:I7)>COUNTIF($E$7:$E$16,$I$6),"",INDEX(A$7:A$16,SUMPRODUCT(SMALL(--($E$7:$E$16=$I$6)*(ROW(A$7:A$16)-ROW(I$6)),COUNTIF($E$7:$E$16,"<>"&$I$6)+ROWS(I$7:I7)))))
 
Upvote 0

Forum statistics

Threads
1,224,270
Messages
6,177,574
Members
452,784
Latest member
talippo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top