+ Reply to Thread
Results 1 to 16 of 16

split formula of data not giving expected results need assistance

  1. #1
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    split formula of data not giving expected results need assistance

    I have a worksheet where I split description of goods of column G in column in J based on column K,L,M and U as criteria column H which represents a code how I am having an issue with one of them starting with 1702.

    the expected should read in in column J 6*20*70 CL instead showing blank

    Can anyone assist in formula .

    I have hide the other rows to show the the row I having trouble
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,178

    Re: split formula of data not giving expected results need assistance

    It fails on the test of H173 starting with 2; If you change formula in J ..

    =IF(AND(LEFT(H173)="1".....


    you will get your result.

    So which is it?
    Last edited by JohnTopley; 05-15-2018 at 04:28 AM.

  3. #3
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: split formula of data not giving expected results need assistance

    I think the problem may be the Tariff No. beginning with 1 instead of 2???

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: split formula of data not giving expected results need assistance

    Is the HS code 17029010 for Syrup? I think it is for Palmyra Sugar which is not in liquid shape.
    Quang PT

  5. #5
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    Re: split formula of data not giving expected results need assistance

    Hi John

    Putting one does get the results however dragging as the others starts with 2 give me a blank.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,178

    Re: split formula of data not giving expected results need assistance

    Yes, but i do not what the right check should be.

    The formula is wrong and/or the coding number is wrong.

  7. #7
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    Re: split formula of data not giving expected results need assistance

    What I was meaning that all the data is correct in column J except as below which starts with 1 instead of 2

    17029010 SYRUP

    However I have to stick to your suggestion in post 2 for that type of reference .

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,178

    Re: split formula of data not giving expected results need assistance

    Can you not check if it is 1 OR 2 ???

  9. #9
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    Re: split formula of data not giving expected results need assistance

    most of them are 2 only which is correct but additional coding introduced starting 1 which is the issue othwerwise need to think how this can be done with the existing formula.

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,178

    Re: split formula of data not giving expected results need assistance

    This ....????

    =IF(AND(OR(LEFT(H173)="1",LEFT(H173)="2"),LEFT(H173,4)<>"2008"),IF(I173="WINES",K173&"*"&L173&"*"&IFERROR(LOOKUP(1,-FIND({37.5;75;"5L";"2L";"1.5L";"1L";"3L";"5L"},G173),{"37.5CL";"75CL";"5L";"2L";"1.5L";"1L";"3L";"5L"}),"75CL"),IF(U173="*",M173&"*"&LOOKUP(9^9,0+RIGHT(LEFT(G173,LOOKUP(9^9,FIND("X",G173,ROW($1:$99)))-1),{1,2,3}))&"*",K173&"*"&L173&"*")&LOOKUP(1,-FIND({20;25;30;33;50;70;75;100;"1L";"1.5L";"1L5";"2L"},G173),{"20CL";"25CL";"30CL";"33CL";"50CL";"70CL";"75CL";"100CL";"1L";"1.5L";"1.5L";"2L"})),"")

  11. #11
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    Re: split formula of data not giving expected results need assistance

    On right track but it looking also products with G e.g biscuits , I highlighted it in red

    it applies only drinking items that it is juices , wines , shandy , liqueur ,mixed juices , ice tea

    Added sheet with expected results from your adjustments
    Attached Files Attached Files

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,178

    Re: split formula of data not giving expected results need assistance

    This ... add to list ...

    =IF(OR(I2={"juices","wines","beer","liqueur","mixed juices","ice tea"}),IF(AND(OR(LEFT(H2)="1",LEFT(H2)="2"),LEFT(H2,4)<>"2008"),IF(I2="WINES",K2&"*"&L2&"*"&IFERROR(LOOKUP(1,-FIND({37.5;75;"5L";"2L";"1.5L";"1L";"3L";"5L"},G2),{"37.5CL";"75CL";"5L";"2L";"1.5L";"1L";"3L";"5L"}),"75CL"),IF(U2="*",M2&"*"&LOOKUP(9^9,0+RIGHT(LEFT(G2,LOOKUP(9^9,FIND("X",G2,ROW($1:$99)))-1),{1,2,3}))&"*",K2&"*"&L2&"*")&LOOKUP(1,-FIND({20;25;30;33;50;70;75;100;"1L";"1.5L";"1L5";"2L"},G2),{"20CL";"25CL";"30CL";"33CL";"50CL";"70CL";"75CL";"100CL";"1L";"1.5L";"1.5L";"2L"})),""),"")

    I would probably have gone for a VBA solution as this is getting quite complex.
    Last edited by JohnTopley; 05-15-2018 at 11:51 AM.

  13. #13
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,178

    Re: split formula of data not giving expected results need assistance

    Why does I2 have a specific test for WINES?

    =IF(OR(I2={"juices","wines","beer","liqueur","mixed juices","ice tea"}),IF(AND(OR(LEFT(H2)="1",LEFT(H2)="2"),LEFT(H2,4)<>"2008"),IF(I2="WINES",K2&"*"&L2&"*"&IFERROR(LOOKUP(1,-FIND({37.5;75;"5L";"2L";"1.5L";"1L";"3L";"5L"},G2),{"37.5CL";"75CL";"5L";"2L";"1.5L";"1L";"3L";"5L"}),"75CL"),IF(U2="*",M2&"*"&LOOKUP(9^9,0+RIGHT(LEFT(G2,LOOKUP(9^9,FIND("X",G2,ROW($1:$99)))-1),{1,2,3}))&"*",K2&"*"&L2&"*")&LOOKUP(1,-FIND({20;25;30;33;50;70;75;100;"1L";"1.5L";"1L5";"2L"},G2),{"20CL";"25CL";"30CL";"33CL";"50CL";"70CL";"75CL";"100CL";"1L";"1.5L";"1.5L";"2L"})),""),"")

  14. #14
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    Re: split formula of data not giving expected results need assistance

    I have adjusted , concerning your query it was adjusted by someone else . I did not asked .

    However now it is working but agree it is very complex and tedious task.

    However if a vba solution is available , it is the most welcome

    Thank you for your patience to solve this complex puzzle formula.

    The only flaw that description need to be adjusted in the formula which may be prone to error



    Please Login or Register  to view this content.


    =IF(OR(I2={"juices","wines","beer","liqueurs","mixed juices","ice tea","syrup","fruit juice","energy drinks","mineral water","gins","vodkha","shandy","beverages","tequilla","energy drinks can","mixed juices","orange juices","apple juices","grape juices","grapefruit juice","vodka","aerated juices"}),IF(AND(OR(LEFT(H2)="1",LEFT(H2)="2"),LEFT(H2,4)<>"2008"),IF(I2="WINES",K2&"*"&L2&"*"&IFERROR(LOOKUP(1,-FIND({37.5;75;"5L";"2L";"1.5L";"1L";"3L";"5L"},G2),{"37.5CL";"75CL";"5L";"2L";"1.5L";"1L";"3L";"5L"}),"75CL"),IF(U2="*",M2&"*"&LOOKUP(9^9,0+RIGHT(LEFT(G2,LOOKUP(9^9,FIND("X",G2,ROW($1:$99)))-1),{1,2,3}))&"*",K2&"*"&L2&"*")&LOOKUP(1,-FIND({20;25;30;33;50;70;75;100;"1L";"1.5L";"1L5";"2L"},G2),{"20CL";"25CL";"30CL";"33CL";"50CL";"70CL";"75CL";"100CL";"1L";"1.5L";"1.5L";"2L"})),""),"")
    Last edited by JEAN1972; 05-15-2018 at 12:48 PM.

  15. #15
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,178

    Re: split formula of data not giving expected results need assistance

    TRY

    =IFERROR(IF(MATCH(I2,$AJ$2:$AJ$25,0),IF(AND(OR(LEFT(H2)="1",LEFT(H2)="2"),LEFT(H2,4)<>"2008"),IF(I2="WINES",K2&"*"&L2&"*"&IFERROR(LOOKUP(1,-FIND({37.5;75;"5L";"2L";"1.5L";"1L";"3L";"5L"},G2),{"37.5CL";"75CL";"5L";"2L";"1.5L";"1L";"3L";"5L"}),"75CL"),IF(U2="*",M2&"*"&LOOKUP(9^9,0+RIGHT(LEFT(G2,LOOKUP(9^9,FIND("X",G2,ROW($1:$99)))-1),{1,2,3}))&"*",K2&"*"&L2&"*")&LOOKUP(1,-FIND({20;25;30;33;50;70;75;100;"1L";"1.5L";"1L5";"2L"},G2),{"20CL";"25CL";"30CL";"33CL";"50CL";"70CL";"75CL";"100CL";"1L";"1.5L";"1.5L";"2L"})),""),""),"")

    AJ2:AJ25 has list of valid products
    Attached Files Attached Files

  16. #16
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    Re: split formula of data not giving expected results need assistance

    Thank you lot John

    tested works a charm, more easy than to enter manually in the formual

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] assistance required copy macro not giving expected results to new sheet
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-14-2017, 01:37 PM
  2. Formula not returning expected results
    By Mlabrec in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-07-2016, 08:08 PM
  3. [SOLVED] Index - Match formula not giving me an expected result
    By longbow007 in forum Excel General
    Replies: 5
    Last Post: 11-25-2015, 07:34 PM
  4. Replies: 2
    Last Post: 08-24-2014, 04:56 AM
  5. "IF" statement not giving expected results
    By khank in forum Excel General
    Replies: 6
    Last Post: 11-17-2010, 04:14 PM
  6. IF Formula not giving expected results.
    By fungus in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-17-2010, 02:10 PM
  7. Sumproduct formula not giving expected results
    By Shocked in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 09-30-2008, 03:12 PM

Bookmarks

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