SumIF & Vlookup help

Hobbit2010

New Member
Joined
Feb 28, 2024
Messages
4
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hi can someone please help me with a formula to return value in the following blank columns highlighted in yellow in the example attached ?

In summary I want to pull currencies for each employee and a sum total of those currency in a separate column. In my analysis there are max two payment currencies for each employee.

Any speed injected in helping with the formula will be much appreciated.

Many thanks in advance.
 

Attachments

  • Excel query.JPG
    Excel query.JPG
    106.9 KB · Views: 12

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
To start, in order to pull the currency you can do something like this:

Excel Formula:
TAKE(FILTER(C2:C9,(B2:B9=H2)*(A2:A9=G2)),1)

1709169302293.png


How do you want the currency displayed? Is there an order of preference? Shelly has USD and GBP. Which one would you like to pull? It is a bit hard to pull the data using a lookup since the table on the left does not contain unique values.
 
Upvote 0
To start, in order to pull the currency you can do something like this:

Excel Formula:
TAKE(FILTER(C2:C9,(B2:B9=H2)*(A2:A9=G2)),1)

View attachment 107671

How do you want the currency displayed? Is there an order of preference? Shelly has USD and GBP. Which one would you like to pull? It is a bit hard to pull the data using a lookup since the table on the left does not contain unique values.
Thank you so much in looking into this, I am struggling to see what formula to use to return for example if we take Shelly I am after a formula which returns in cell I2 = USD; Cell J2=sum of USD (i.e $4000); cell K2 = GBP and then cell L2=6000 (i.e. sum of GBP amount. Do you think its possible via a combination of vlookup, IF and SumIF formula or any other way to return those values? Thank you so much in advance.
 
Upvote 0
It is a bitty risky assuming 2 currencies.
This might work for your yellow columns.

Your are indicating you are using 2 versions of Excel. I am not sure that 2021 supports Take.

20240229 Extract and Sum 2 currencies Hobbit2010.xlsx
ABCDEFGHIJKL
1
2Emp IDNameCurrencyAmountEmp IDNameCurrency 1Sum amtCurrency 2sum amount 2
31001ShellyUSD10001001ShellyUSD4000GBP6000
41001ShellyGBP20001002KimAUD18000USD8000
51001ShellyUSD3000
61001ShellyGBP4000
71002KimAUD5000
81002KimAUD6000
91002KimAUD7000
101002KimUSD8000
Sheet1
Cell Formulas
RangeFormula
I3:I4I3=XLOOKUP(G3,$A$3:$A$10,$C$3:$C$10,"")
J3:J4J3=SUMIFS($D$3:$D$10,$A$3:$A$10,$G3,$C$3:$C$10,I3)
K3:K4K3=XLOOKUP(1,($A$3:$A$10=G3)*($C$3:$C$10<>$I3),$C$3:$C$10,"")
L3:L4L3=IF(K3<>"",SUMIFS($D$3:$D$10,$A$3:$A$10,$G3,$C$3:$C$10,K3),"")
 
Upvote 1
Similar approach to Alex.

Book1
ABCDEFGHIJK
1
2Emp IDNameCurrencyAmountEmp IDNameCurrency 1amountCurrency 2amount
31001ShellyUSD1,0001001ShellyUSD4,000GBP6,000
41001ShellyGBP2,0001002KimAUD5,000GBP30,000
51001ShellyUSD3,0001003BridgetGBP46,000AUD14,000
61001ShellyGBP4,0001004KyleAUD15,000  
71002KimAUD5,0001005AndrewUSD16,000AUD17,000
81002KimGBP6,0001006TimAUD18,000GBP39,000
91002KimGBP7,000
101002KimGBP8,000
111002KimGBP9,000
121003BridgetGBP10,000
131003BridgetGBP11,000
141003BridgetGBP12,000
151003BridgetGBP13,000
161003BridgetAUD14,000
171004KyleAUD15,000
181005AndrewUSD16,000
191005AndrewAUD17,000
201006TimAUD18,000
211006TimGBP19,000
221006TimGBP20,000
23
Sheet2
Cell Formulas
RangeFormula
G3:G8G3=VLOOKUP(F3,$A$3:$B$22,2,FALSE)
H3:H8H3=VLOOKUP(F3,$A$3:$C$22,3,FALSE)
I3:I8I3=SUMIFS($D$3:$D$22,$A$3:$A$22,$F3,$C$3:$C$22,H3)
J3:J8J3=UNIQUE(FILTER($C$3:$C$22,($A$3:$A$22=F3)*($C$3:$C$22<>H3),""))
K3:K8K3=IF(J3<>"",SUMIFS($D$3:$D$22,$A$3:$A$22,$F3,$C$3:$C$22,J3),"")
 
Upvote 1
Thank you Alex and Kevin, can I please check if the two tables are in separate tabs if the above formulas should work, cause as soon as I am pulling the same columns as suggested by you from a different tab for SUMIFS formula it is giving me an error of too many arguments put in. For clarity I have column A to D in Tab 2 and Tab 1 has the highlighted cells where I want to input the formula. I am new to this forum so not sure how to upload the worksheet for ease. I am using microsoft 365 excel version for my analysis. Thank you again.
 
Upvote 0
Shouldn't be a problem:
Book1
ABCDE
1
2Emp IDNameCurrencyAmount
31001ShellyUSD1,000
41001ShellyGBP2,000
51001ShellyUSD3,000
61001ShellyGBP4,000
71002KimAUD5,000
81002KimGBP6,000
91002KimGBP7,000
101002KimGBP8,000
111002KimGBP9,000
121003BridgetGBP10,000
131003BridgetGBP11,000
141003BridgetGBP12,000
151003BridgetGBP13,000
161003BridgetAUD14,000
171004KyleAUD15,000
181005AndrewUSD16,000
191005AndrewAUD17,000
201006TimAUD18,000
211006TimGBP19,000
221006TimGBP20,000
23
Tab 2


Book1
ABCDEF
1Emp IDNameCurrency 1amountCurrency 2amount
21001ShellyUSD4,000GBP6,000
31002KimAUD5,000GBP30,000
41003BridgetGBP46,000AUD14,000
51004KyleAUD15,000  
61005AndrewUSD16,000AUD17,000
71006TimAUD18,000GBP39,000
8
Tab 1
Cell Formulas
RangeFormula
B2:B7B2=VLOOKUP(A2,'Tab 2'!$A$3:$B$22,2,FALSE)
C2:C7C2=VLOOKUP(A2,'Tab 2'!$A$3:$C$22,3,FALSE)
D2:D7D2=SUMIFS('Tab 2'!$D$3:$D$22,'Tab 2'!$A$3:$A$22,$A2,'Tab 2'!$C$3:$C$22,C2)
E2:E7E2=UNIQUE(FILTER('Tab 2'!$C$3:$C$22,('Tab 2'!$A$3:$A$22=A2)*('Tab 2'!$C$3:$C$22<>C2),""))
F2:F7F2=IF(E2<>"",SUMIFS('Tab 2'!$D$3:$D$22,'Tab 2'!$A$3:$A$22,$A2,'Tab 2'!$C$3:$C$22,E2),"")
 
Upvote 1
Solution
To upload a worksheet, you could download the XL2BB add in, or alternatively, share your file via Google Drive, Dropbox or similar file sharing platform - just remember to make the file available to anyone with the link :)
 
Upvote 1
Thank you heaps Kevin, this has saved so much of my time and energy :). Really appreciate all the help and so glad I joined this forum 👏👏.
 
Upvote 0
Glad we were able to help & welcome to the Forum. :) (y)
Given that you have 365, it would be worth learning about the XLOOKUP functions that @Alex Blakenburg suggested in post #4
 
Upvote 0

Forum statistics

Threads
1,215,094
Messages
6,123,071
Members
449,092
Latest member
ipruravindra

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