+ Reply to Thread
Results 1 to 10 of 10

How to calculate the difference between values with columns of different codes

  1. #1
    Registered User
    Join Date
    07-12-2022
    Location
    Maryland, USA
    MS-Off Ver
    Microsoft Office Professional Plus 2019
    Posts
    8

    How to calculate the difference between values with columns of different codes

    Hi,

    I need help to calculate the difference in the price of each procedure code in two tables. Each table is from different organizations (the one on the right is my organization, and the one on the left is the other one), so the procedure codes are not all in the same order, and there are some codes that might be in one that are not in the other. I would just need to calculate the difference in price in the column named Fee and for the procedures that are in both tables.

    The example I added has just one mismatch, but the original has more mismatches between the order of procedure codes due to missing codes, although I tried to sort it the best possible.

    Thanks for any help
    Attached Files Attached Files

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: How to calculate the difference between values with columns of different codes

    Could you give us a couple of examples of your expected results, and if not immediately obvious how you arrived at those figures some more detail on how they were derived?

    BSB

  3. #3
    Registered User
    Join Date
    07-12-2022
    Location
    Maryland, USA
    MS-Off Ver
    Microsoft Office Professional Plus 2019
    Posts
    8

    Re: How to calculate the difference between values with columns of different codes

    Thank for the help BadlySpelledBuoy

    So I am just trying to get the difference between the fee values for each code; a simple subtraction formula would not help because the procedures, although sorted, are not in the exact order; the example just shows 1 procedure that repeats, and the total order changes. Further down in the original data, there are more changes, so the order of cells in both tables changes.

    These are medical procedure codes, so the data on the left table are the fees that are on the webpage from CMS (Medicare), and the table on the right is my organization's fees for the same code. There is a lot of data, and I was trying to find a formula that could do this. I have tried Chat GPT but the formulas that it has given me don't seem to subtract the different fees for each of the codes in the list

    I hope this answers your question.

    Thanks

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: How to calculate the difference between values with columns of different codes

    Taking procedure code 10004 as an example, in the left table it's 57.64 and on the right it's 133.00, so your expected result there would be 75.36?

    If so try the below formula somewhere in row 2 and copy down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    BSB

  5. #5
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: How to calculate the difference between values with columns of different codes

    Another formula using named tables.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,893

    Re: How to calculate the difference between values with columns of different codes

    Another way is with Power Query

    le
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  7. #7
    Registered User
    Join Date
    07-12-2022
    Location
    Maryland, USA
    MS-Off Ver
    Microsoft Office Professional Plus 2019
    Posts
    8

    Re: How to calculate the difference between values with columns of different codes

    This one worked perfectly! Just what I needed. Thank you very much for the help!

  8. #8
    Registered User
    Join Date
    07-12-2022
    Location
    Maryland, USA
    MS-Off Ver
    Microsoft Office Professional Plus 2019
    Posts
    8

    Re: How to calculate the difference between values with columns of different codes

    Hi DJunqueira,

    Thanks for the formula. I'll try this one to have another back up for other projects I might have to use this!

  9. #9
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: How to calculate the difference between values with columns of different codes

    Tks for the feedback, glad to help.

  10. #10
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,893

    Re: How to calculate the difference between values with columns of different codes

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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] Finding out the difference between two sets of codes -repetitive codes and interchanged
    By chandramouliarun in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-11-2020, 07:05 AM
  2. Trying to Calculate Difference from two columns
    By dcoughl in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 10-01-2020, 11:37 AM
  3. [SOLVED] Formula to calculate Tax values on net value depending on dealer codes
    By abhinavbinkar in forum Excel General
    Replies: 2
    Last Post: 12-30-2018, 03:09 AM
  4. Replies: 1
    Last Post: 08-14-2014, 10:37 AM
  5. [SOLVED] Pivot table with years on columns. I cant calculate a difference in values
    By Daniel_da6 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 05-17-2013, 12:13 PM
  6. [SOLVED] how to calculate difference in two columns either positive or negative ?
    By spandan21 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-29-2012, 10:40 AM
  7. Replies: 1
    Last Post: 02-09-2006, 08:45 PM

Tags for this Thread

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