SOLVED

Help splitting order numbers by character for reconciliation

%3CLINGO-SUB%20id%3D%22lingo-sub-3095923%22%20slang%3D%22en-US%22%3EHelp%20splitting%20order%20numbers%20by%20character%20for%20reconciliation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3095923%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EHi%20all%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EIn%20all%20my%20years%20of%20Excel%20use%2C%20I've%20never%20come%20across%20such%20a%20stupid%20human-made%20issue.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20currently%20need%20to%20get%20an%20orders%20report%20from%20a%20supplier%20and%20reconcile%20them%2C%20however%2C%20they%20have%20decided%20to%20consolidate%20orders%20together%20on%20a%20line%20(which%20technically%20makes%20sense%2C%20since%20my%20organisation%20is%20also%20doing%20the%20stupid%20thing%20of%20submitting%20each%20line%20as%20an%20order).%20As%20such%2C%20I'm%20in%20the%20middle%2C%20and%20it's%20my%20problem%20to%20fix...%20I've%20attached%20a%20very%20basic%20version%20of%20the%20issue.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ELink%20to%20example%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.google.com%2Fspreadsheets%2Fd%2F1EDeFD1zlE9QVzuY30EwyYcGlFFziBq11%2Fedit%3Fusp%3Dsharing%26amp%3Bouid%3D101374203065416329820%26amp%3Brtpof%3Dtrue%26amp%3Bsd%3Dtrue%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.google.com%2Fspreadsheets%2Fd%2F1EDeFD1zlE9QVzuY30EwyYcGlFFziBq11%2Fedit%3Fusp%3Dsharing%26amp%3Bouid%3D101374203065416329820%26amp%3Brtpof%3Dtrue%26amp%3Bsd%3Dtrue%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20have%20another%20report%20from%20my%20side%2C%20which%20I%20can%20use%20to%20reconcile%20(this%20will%20be%20the%20same%20as%20the%20%22should%20look%20like%22%20part%20of%20the%20Excel).%20I%20was%20thinking%20I'd%20run%20an%20Index%2FMatch%20type%20scenario%20to%20then%20line%20up%20the%20order%20numbers%20with%20the%20product%20code%20and%20quantity%20from%20the%20supplier%20and%20us%20at%20the%20end.%20Happy%20for%20any%20ideas.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EIn%20summary%2C%20I%20need%20to%3A%3C%2FSPAN%3E%3C%2FP%3E%3CUL%3E%3CLI%3E%3CSPAN%3ESplit%20the%20order%20numbers%20containing%20%22%26amp%3B%22%20and%20have%20them%20double%20checked%20against%20my%20data%20to%20ensure%20the%20product%20and%20quantity%20are%20correct.%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3EThe%20number%20of%20rows%20from%20theirs%20and%20the%20output%20should%20be%20the%20same.%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3EThere%20are%20duplicate%20order%20numbers%2C%20which%20need%20to%20reconcile%20against%20my%20data%20also.%3C%2FSPAN%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3EI%20also%20prefer%20using%20Formulas%2C%20but%20am%20also%20open%20to%20Excel%20365%20scripts%20('new%20macros'%20as%20I%20call%20them)%2C%20as%20I'm%20trying%20to%20build%20this%20as%20a%20bigger%20process%20in%20Power%20Automate.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThanks%20guys%2C%20I%20have%20spent%20the%20last%20week%20on%20this%2C%20thinking%20I%20had%20it%2C%20only%20to%20have%20another%20issue%20throw%20itself%20at%20me%20in%20the%20process...%20I%20just%20can't%20understand%20why%20anyone%20would%20do%20it%20this%20way...%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3095923%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%20for%20web%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3097113%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20splitting%20order%20numbers%20by%20character%20for%20reconciliation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3097113%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F567158%22%20target%3D%22_blank%22%3E%40GrandMoffReknaw%3C%2FA%3E%26nbsp%3BIf%20you%20insist%20on%20using%20Excel%20for%20the%20web%20I%20can't%20think%20of%20an%20easy%20way%2C%20but%20if%20you%20can%20get%20your%20hands%20on%20the%20desktop%20(PC%2C%20not%20Mac)%20version%20you%20can%20fairly%20easily%20transform%20the%20%22stupid%22%20list%20into%20something%20more%20useful%20with%20Power%20Query.%20See%20attached.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3103675%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20splitting%20order%20numbers%20by%20character%20for%20reconciliation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3103675%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F567158%22%20target%3D%22_blank%22%3E%40GrandMoffReknaw%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAssuming%20data%20stored%20in%26nbsp%3B%3CEM%3E%3CSTRONG%3EtblOrders%3C%2FSTRONG%3E%3C%2FEM%3E%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F344478i0B76D9AE09140DA2%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Screenshot.png%22%20alt%3D%22Screenshot.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3Ein%26nbsp%3B%3CSTRONG%3EF4%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel-formula%22%3E%3CCODE%3E%3DIF(ISNUMBER(SEARCH(%22%20%26amp%3B%20%22%2C%5B%40%5BOrder%20Number%5D%5D))%2C%0A%20%20%20%20LET(%0A%20%20%20%20%20%20Delim%2C%20%20%22%7C%22%2C%0A%20%20%20%20%20%20Value%2C%20%20SUBSTITUTE(%5B%40%5BOrder%20Number%5D%5D%2C%20%22%20%26amp%3B%20%22%2C%20Delim)%2C%0A%20%20%20%20%20%20seqLen%2C%20SEQUENCE(%20LEN(Value)%2B1%20)%2C%0A%20%20%20%20%20%20arrStart%2C%0A%20%20%20%20%20%20%20%20LET(%0A%20%20%20%20%20%20%20%20%20%20Dvalue%2C%20Delim%20%26amp%3B%20Value%2C%0A%20%20%20%20%20%20%20%20%20%20split%2C%20%20MID(Dvalue%2C%20seqLen%2C%201)%2C%0A%20%20%20%20%20%20%20%20%20%20arr%2C%20%20%20%20(split%20%3D%20Delim)%20*%20seqLen%2C%0A%20%20%20%20%20%20%20%20%20%20FILTER(arr%2C%20arr%20%26gt%3B%200)%0A%20%20%20%20%20%20%20%20)%2C%0A%20%20%20%20%20%20arrEnd%2C%0A%20%20%20%20%20%20%20%20LET(%0A%20%20%20%20%20%20%20%20%20%20valueD%2C%20Value%20%26amp%3B%20Delim%2C%0A%20%20%20%20%20%20%20%20%20%20split%2C%20%20MID(valueD%2C%20seqLen%2C%201)%2C%0A%20%20%20%20%20%20%20%20%20%20arr%2C%20%20%20%20(split%20%3D%20Delim)%20*%20seqLen%2C%0A%20%20%20%20%20%20%20%20%20%20FILTER(arr%2C%20arr%20%26gt%3B%200)%0A%20%20%20%20%20%20%20%20)%2C%0A%20%20%20%20%20%20arrValues%2C%20%20MID(Value%2C%20arrStart%2C%20arrEnd-arrStart)%2C%0A%20%20%20%20%20%20valueOccur%2C%20COUNTIF(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20OFFSET(tblOrders%5B%5B%23Headers%5D%2C%5BOrder%20Number%5D%5D%2C1%2C0%2C(ROW()-ROW(tblOrders%5B%23Headers%5D)))%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B%40%5BOrder%20Number%5D%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20)%2C%0A%20%20%20%20%20%20INDEX(arrValues%2C%20valueOccur)%0A%20%20%20%20)%2C%0A%20%20%20%20%5B%40%5BOrder%20Number%5D%5D%0A)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3ECorresponding%20sample%20attached%20(tested%20in%20Excel%20Web)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Established Member

Hi all,

 

In all my years of Excel use, I've never come across such a stupid human-made issue.

I currently need to get an orders report from a supplier and reconcile them, however, they have decided to consolidate orders together on a line (which technically makes sense, since my organisation is also doing the stupid thing of submitting each line as an order). As such, I'm in the middle, and it's my problem to fix... I've attached a very basic version of the issue.

 

Link to example: https://docs.google.com/spreadsheets/d/1EDeFD1zlE9QVzuY30EwyYcGlFFziBq11/edit?usp=sharing&ouid=10137...

 

I have another report from my side, which I can use to reconcile (this will be the same as the "should look like" part of the Excel). I was thinking I'd run an Index/Match type scenario to then line up the order numbers with the product code and quantity from the supplier and us at the end. Happy for any ideas.

 

In summary, I need to:

  • Split the order numbers containing "&" and have them double checked against my data to ensure the product and quantity are correct.
  • The number of rows from theirs and the output should be the same.
  • There are duplicate order numbers, which need to reconcile against my data also.

I also prefer using Formulas, but am also open to Excel 365 scripts ('new macros' as I call them), as I'm trying to build this as a bigger process in Power Automate.

 

Thanks guys, I have spent the last week on this, thinking I had it, only to have another issue throw itself at me in the process... I just can't understand why anyone would do it this way...

2 Replies

@GrandMoffReknaw If you insist on using Excel for the web I can't think of an easy way, but if you can get your hands on the desktop (PC, not Mac) version you can fairly easily transform the "stupid" list into something more useful with Power Query. See attached.

 

best response confirmed by GrandMoffReknaw (Established Member)
Solution

Hi @GrandMoffReknaw 

 

Assuming data stored in tblOrders:

Screenshot.png

in F4

 

 

=IF(ISNUMBER(SEARCH(" & ",[@[Order Number]])),
    LET(
      Delim,  "|",
      Value,  SUBSTITUTE([@[Order Number]], " & ", Delim),
      seqLen, SEQUENCE( LEN(Value)+1 ),
      arrStart,
        LET(
          Dvalue, Delim & Value,
          split,  MID(Dvalue, seqLen, 1),
          arr,    (split = Delim) * seqLen,
          FILTER(arr, arr > 0)
        ),
      arrEnd,
        LET(
          valueD, Value & Delim,
          split,  MID(valueD, seqLen, 1),
          arr,    (split = Delim) * seqLen,
          FILTER(arr, arr > 0)
        ),
      arrValues,  MID(Value, arrStart, arrEnd-arrStart),
      valueOccur, COUNTIF(
                OFFSET(tblOrders[[#Headers],[Order Number]],1,0,(ROW()-ROW(tblOrders[#Headers]))),
                [@[Order Number]]
            ),
      INDEX(arrValues, valueOccur)
    ),
    [@[Order Number]]
)

Corresponding sample attached (tested in Excel Web)