Match name and multiply base on criteria

nparrillo

New Member
Joined
Mar 27, 2023
Messages
29
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
Looking to match names between two columns and then multiply a value by 1 or -1 based on Y or N criteria. Many more names will be added so it needs to be scalable.
 

Attachments

  • inverse v2.png
    inverse v2.png
    25 KB · Views: 10

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Not sure what you mean by scalable, the formula can be copied down. But, try this, and you may need to reverse signs in the formula as you are not specific on what value is to be times 1 or times -1.:
Book1
ABCDEFG
21
22Name(Y/N)NameCountFormula
23SallyYSally2-2
24MarkNMark33
25JamesYMark33
26SueNMark33
27TomNSue44
28Sally2-2
29Tom44
Sheet1
Cell Formulas
RangeFormula
G23:G29G23=IF(VLOOKUP(E23,$B$23:$C$27,2,0)="Y",-1,1)*F23
 
Upvote 0
Not sure what you mean by scalable, the formula can be copied down. But, try this, and you may need to reverse signs in the formula as you are not specific on what value is to be times 1 or times -1.:
Book1
ABCDEFG
21
22Name(Y/N)NameCountFormula
23SallyYSally2-2
24MarkNMark33
25JamesYMark33
26SueNMark33
27TomNSue44
28Sally2-2
29Tom44
Sheet1
Cell Formulas
RangeFormula
G23:G29G23=IF(VLOOKUP(E23,$B$23:$C$27,2,0)="Y",-1,1)*F23
Is this immune to me adding or moving columns? Any way with sumifs?
 
Upvote 0
It is not immune from moving columns in the lookup table. The Name must always be the first column and the (Y/N) must always be the second.
If you want to move either or both of these columns then you should use the following:
Excel Formula:
=Index($C$23:$C$27,match(e23,$B$23:$B$27,0))
(I eyeballed this and did not test it out before typing, but I hope you get the syntax if you have an error returned).

The columns must always be of the same length.

As to SUMIFS, i'm not sure what you mean. What do you want to sum, and based on what criteria? But, really that is a separate question that should probably be put forth in a new post, your original post is based on name matching and getting a new value not getting a summarization based on matching names in a column.
 
Upvote 0
Solution

Forum statistics

Threads
1,215,326
Messages
6,124,265
Members
449,149
Latest member
mwdbActuary

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