RE: Excel formula/VBA code to automatically update the mapping key

Keerthi03

New Member
Joined
Jun 14, 2020
Messages
8
Office Version
  1. 2016
Platform
  1. Windows
Hi Folks,

Based on signage mapping key needs to be updated. I have updated the excel file sample for your reference.



Detailed explanation below:

1) I have an sheet named "Pivot" which contains item details along with its amount related to sales data. What i exactly need is - Excel formula to be updated for the logic-> Wherever negative sign is available in the sum of total amount column, account number need to be changed accordingly. (example – if amount is negative, mapping key should be 50 for account number "607412" and mapping key should be 40 for account number "4016000".

2) If the amount value is positive in sum of total amount column, then the mapping key needs to be change vise versa -> mapping key should be 40 for account number "607412" and mapping key should be 50 for account number "4016000".

Note: I will paste the same data for each code number based on last row one by one, so we need to implement the logic accordingly for mapping key.

Example - final output to be in below format for single amount value:
Sum Amount - Mapping Key - Account Number
(12,588.35) - 40 - 4016000
(12,588.35) - 50 - 607412
 

Attachments

  • test1.PNG
    test1.PNG
    47.8 KB · Views: 13

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
If you can specify the negative mapping key, as well as the positive for each account, it's very easy.
Capture.JPG

Put this in the Mapping Key column
Excel Formula:
=OFFSET($K$1,MATCH(C2,$K$1:$K$3,0)-1,IF(B2>0,1,2))
 
Upvote 0
Welcome to the MrExcel Message Board!

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: RE: Excel Formula to update Account number based on signage using mapping key
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
Do you even need a mapping table ?
That looks like SAP data to me. Typically the mapping works in Account no ranges.
Will something like this work for you.

20220626 SAP Data Posting Key Mapping Keerthi03.xlsx
ABCD
1Code Sum or Total Acct NoPosting Key
21324(12,588.35)60741250
313248,646.2860741240
41324194.8260741240
51324258.9460741240
61324(580.66)60741250
71324(12,588.35)401600040
813248,646.28401600050
91324194.82401600050
101324258.94401600050
111324(580.66)401600040
121324502.0360741240
131324(772.16)60741250
141324(1,671.61)60741250
151324502.03401600050
161324(772.16)401600040
171324(1,671.61)401600040
Sheet1
Cell Formulas
RangeFormula
D2:D17D2=IF(LEN(C2)=6,IF(B2<0,50,40),IF(B2<0,40,50))
 
Upvote 0
Solution
Hi All,

Received solution. I have tried out all combinations and adjusted according to my requirement and it works fine.

@Fluff - Sure, I will make it clear while posting new thread, if any cross posting done, then the same details will be added in my thread going forward.

Thanks all for your help
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,858
Members
449,051
Latest member
excelquestion515

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