Data Extraction with Conditions

Graemea

Board Regular
Joined
Oct 30, 2015
Messages
119
Office Version
  1. 365
Platform
  1. Windows
Hi,

In columns A:L in Sheet1 I have sample sales and profit growth (%) data at the report date and at a previous period (t-1) over 1 year and 3 years.

In columns N:Y I would like to extract from A:L the Product Code, Product Name, Country, Value Sales and Growth numbers for products in which the previous growth value was negative and the current value was positive for each period (1 year and 3 years), or vice-versa.

For example, Product AAA had previous growth of 2.00% (positive number) and current growth of -1.00% (negative number) over 1 year. EEE had previous growth of -1.00% and current growth of 2.00% over 3 years.

Both of these products are therefore included in N:Y.

Product CCC has previous vs current sales growth rates with the same sign in both 1 year and 3 year periods and so is not extracted to N:Y

Can someone please suggest how best to extract data based on these conditions.

Thanks!

PS Someone has previously kindly suggested a solution using FILTER () but didn't quite perform as required (probably due to my poor explanation!)


Extracting Data v2.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXY
1PRODUCT CODEPRODUCT NAMECOUNTRYVALUE1Y SALES-11Y SALES1Y GROWTH-11Y GROWTH3Y SALES-13Y SALES3Y GROWTH-13Y GROWTHPRODUCT CODEPRODUCT NAMECOUNTRYVALUE1Y SALES-11Y SALES1Y GROWTH-11Y GROWTH3Y SALES-13Y SALES3Y GROWTH-13Y GROWTH
2AAAAAA PLCEngland10001001102.00-1.0050.0055.003.004.00AAAAAA PLCEngland10001001102.00-1.00
3BBBBBB PLCEngland15001101203.004.0055.0060.003.005.00EEEEEE PLCEngland30007075-1.002.00
4CCCCCC PLCEngland2000120130-1.00-2.0060.0065.00-1.00-2.00KKKKKK PLCScotland35001501602.00-1.00
5DDDDDD PLCEngland25001301403.005.0065.0070.00-2.00-1.00OOOOOO PLCScotland550095100-1.002.00
6EEEEEE PLCEngland3000140150-1.00-2.0070.0075.00-1.002.00VVVVVV PLCWales60002002102.00-1.00
7KKKKKK PLCScotland35001501602.00-1.0075.0080.003.004.00ZZZZZZ PLCWales8000120125-1.002.00
8LLLLLL PLCScotland40001601703.004.0080.0085.003.005.00
9MMMMMM PLCScotland4500170180-1.00-2.0085.0090.00-1.00-2.00
10NNNNNN PLCScotland50001801903.005.0090.0095.00-2.00-1.00
11OOOOOO PLCScotland5500190200-1.00-2.0095.00100.00-1.002.00
12VVVVVV PLCWales60002002102.00-1.00100.00105.003.004.00
13WWWWWW PLCWales65002102203.004.00105.00110.003.005.00
14XXXXXX PLCWales7000220230-1.00-2.00110.00115.00-1.00-2.00
15YYYYYY PLCWales75002302403.005.00115.00120.00-2.00-1.00
16ZZZZZZ PLCWales8000240250-1.00-2.00120.00125.00-1.002.00
Sheet1
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
How about
+Fluff 1.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXY
1PRODUCT CODEPRODUCT NAMECOUNTRYVALUE1Y SALES-11Y SALES1Y GROWTH-11Y GROWTH3Y SALES-13Y SALES3Y GROWTH-13Y GROWTHPRODUCT CODEPRODUCT NAMECOUNTRYVALUE1Y SALES-11Y SALES1Y GROWTH-11Y GROWTH3Y SALES-13Y SALES3Y GROWTH-13Y GROWTH
2AAAAAA PLCEngland10001001102-1505534AAAAAA PLCEngland10001001102-1 
3BBBBBB PLCEngland150011012034556035EEEEEE PLCEngland3000 7075-12
4CCCCCC PLCEngland2000120130-1-26065-1-2KKKKKK PLCScotland35001501602-1 
5DDDDDD PLCEngland2500130140356570-2-1OOOOOO PLCScotland5500 95100-12
6EEEEEE PLCEngland3000140150-1-27075-12VVVVVV PLCWales60002002102-1 
7KKKKKK PLCScotland35001501602-1758034ZZZZZZ PLCWales8000 120125-12
8LLLLLL PLCScotland400016017034808535
9MMMMMM PLCScotland4500170180-1-28590-1-2
10NNNNNN PLCScotland5000180190359095-2-1
11OOOOOO PLCScotland5500190200-1-295100-12
12VVVVVV PLCWales60002002102-110010534
13WWWWWW PLCWales65002102203410511035
14XXXXXX PLCWales7000220230-1-2110115-1-2
15YYYYYY PLCWales750023024035115120-2-1
16ZZZZZZ PLCWales8000240250-1-2120125-12
Master
Cell Formulas
RangeFormula
N2:Q7N2=FILTER(A2:D16,(SIGN(G2:G16)<>SIGN(H2:H16))+(SIGN(K2:K16)<>SIGN(L2:L16)))
R2:U2,R6:U6,R4:U4,R3,R5,R7R2=LET(Fltr,FILTER($E$2:$H$16,$A$2:$A$16=N2),IF(SIGN(INDEX(Fltr,3))=SIGN(INDEX(Fltr,4)),"",Fltr))
V2,V4,V6,V7:Y7,V5:Y5,V3:Y3V2=LET(Fltr,FILTER($I$2:$L$16,$A$2:$A$16=N2),IF(SIGN(INDEX(Fltr,3))=SIGN(INDEX(Fltr,4)),"",Fltr))
Dynamic array formulas.
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,825
Messages
6,181,190
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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