BOM comparison - excel function

Dušica Garović 10 Reputation points
2026-08-13T06:58:27.5666667+00:00

I need to check if data from the current BOM ERP(article + quantity) is the same or have some differences from the master file (article + quantity).

I tried to do it with xlookup/if function but every time some error occurs, as it can be visible in the photo 2. For both equal data, function shows that the values are different. I don't know what can be the cause when all the data has the same format. User's image

User's image

Microsoft 365 and Office | Excel | For business | Other
0 comments No comments

6 answers

Sort by: Newest
  1. Dušica Garović 10 Reputation points
    2026-08-13T08:08:52.8666667+00:00

    The functions I used:

    =XLOOKUP(C4,H4:H35,H4:H35,"nije pronadjeno")

    =IF(COUNTIF(H6:H37,C6)=0,"ZA BRISANJE","OK")

    I couldnt attach the excel file in this form.

    Was this answer helpful?

    0 comments No comments

  2. TERRENCE KHODANI MUDAU 0 Reputation points
    2026-08-13T08:02:05.5133333+00:00

    that's really fine

    Was this answer helpful?


  3. TERRENCE KHODANI MUDAU 0 Reputation points
    2026-08-13T08:00:48.8533333+00:00

    everything is under control

    Was this answer helpful?

    0 comments No comments

  4. Liora 1,630 Reputation points Independent Advisor
    2026-08-13T07:33:39.49+00:00

    Dear @Dušica Garović,

    I hope you’re having a good day. 

    Thank you for the screenshots and the additional information.

    Based on what I can see, your approach of creating a combined key such as: **Article & "|" & Quantity**is a reasonable way to compare the ERP BOM against the Master BOM.

    However, from your screenshots, I notice that some values appear visually identical (for example, 2007.0689|1) but still return different results. In situations like this, the issue is often caused by one of the following:

    • Hidden spaces before or after the value.
    • Non-printable characters imported from the ERP system.
    • One side being stored as text while the other is stored as number.
    • Quantity values that look the same due to formatting but differ internally.

    Could you please try the following checks?

    1. Compare the lengths of the two keys
    • For two values that appear identical, use: **=LEN(A2)**and =LEN(B2)
    • If the lengths are different, there is likely an invisible character or extra space.
    1. Clean the values before comparing
    • Try rebuilding the concatenated key using: =TRIM(CLEAN(ArticleCell)) & "|" & TRIM(CLEAN(QtyCell)) and then perform the lookup again.
    1. Check whether Excel sees the values as equal
    • For a pair that appears identical, test: =A2=B2
    • If Excel returns FALSE, then there is some hidden difference in the underlying values.
    1. Verify the lookup formula
    • I also notice a #REF! error in one of the screenshots. This can indicate that the lookup formula is referencing an invalid range or a deleted column. Could you please share the exact formula you are using for the comparison?

    If possible, could you upload a small sample workbook containing a few ERP rows and Master rows that reproduce the issue? That would make it much easier to determine whether the problem is coming from the data itself or from the formula.

      

    I hope this information helps point you in the right direction. If you run into any issues while trying the steps, or if something still doesn’t feel quite right, please don’t hesitate to reach out again. I’ll do my best to support you however I can.   

    Looking forward to hearing back from you with any updates or additional details.  

    Warm regards,  


    If the answer is helpful, please select "Yes" and kindly upvote it. If you have extra questions about this answer, please click "Comment".  

    Note: Please follow the steps in the forum documentation to enable email notifications if you want to receive the related email notification for this thread.  

    Was this answer helpful?

    1 person found this answer helpful.

  5. Dušica Garović 10 Reputation points
    2026-08-13T07:13:52.9233333+00:00

    User's image

    I have created additional columns which combine the data - article+quantity. All have format general.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.