problem with xlook up if lookup array colume has duplicate values

Joined
Nov 26, 2023
Messages
4
Office Version
  1. 2021
Platform
  1. Windows
hello every one

as you see the formulas cell is the red one and there are two sheets the left one is total
so i try to get the amount from total (sheet) to the right sheet
but there are duplicate values in lookup array (F) column what is solution to consider the duplicate values
to get the amount( return array) of each value so the total of amount in two sheets is equal (don't miss amount of any duplicated value )

thanks
aaaaa.jpg
 

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
sumif()
rather than a lookup
then you will add any duplicate values as well to the total
 
Upvote 0
sumif()
rather than a lookup
then you will add any duplicate values as well to the total
thank you brother but how i use
you must know that the sheet in right dont have any amount i will get the amount consider the number of WO with xlookup
but the numbers of WO in the left are have duplecation
 
Upvote 0
=sumif( $F:$F ,BV9, $O:$O)
add the table name and worksheet name
difficult to see in an image and NOT UK language , so not sure of the letters used
BUT the sumif will not work if the workbook is closed - both have to be open

for a closed workbook, may need a SUMPRODUCT() - is this case the workbook is closed or open

all in 1 sheet - so your filename and sheet need to be added and use a range - not column reference
Book3
ABCDEFG
1lookupreturncriteriaSUMIFSUMPRODUCT
2a1818
3
4a12
5
6
7
8a6
9
Sheet3
Cell Formulas
RangeFormula
E2E2=SUMIF(A2:A15,D2,B2:B15)
G2G2=SUMPRODUCT((A2:A16=D2)*(B2:B16))



Note: Images are difficult to see , and also requires that I input all the data myself, which means I may make an error, which is very time consuming, and from my point of view less likely to get a response, if a complicated spreadsheet. Plus we cannot see any of the formulas used.

Therefore -

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

This will possibly enable a quicker and more accurate solution for you.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone

---
 
Last edited:
Upvote 0
Upvote 0
a small sample with expected results - would have been better
however
=SUMIF([Book2.xlsx]Sheet1!$C$4:$C$10000,A8,[Book2.xlsx]Sheet1!$F$4:$F$10000)

i have saved the files and created a formula - which will simply SUM column F in book2 - based on the criteria in A and book2 column C

and sumproduct which will work if book2 is closed

Book1.xlsx
ABCDEFGH
516,949,045.63
6sumproduct
7W/OType Paid Amount Paid Date Paid Amount Paid Date2
8802262937-0
91220307711-0
101220571051-0
111321850041-0
121322315377-0
1313226989073-0
141420153907-0
151420285067-0
161420602182-0
171420649907-0
181420655817-0
19222002680506230.001/26/23230.00230
201421443327-0
2114215743573-0
221421747607-0
2314220813723-0
24222002683506230.001/26/23230.00230
251422252231-0
2614224879823-0
2714224880423-0
Sheet1
Cell Formulas
RangeFormula
C5C5=SUBTOTAL(9,C8:C999998)
E8:E27E8=SUMIF([Book2.xlsx]Sheet1!$C$4:$C$10000,A8,[Book2.xlsx]Sheet1!$F$4:$F$10000)
H8:H27H8=SUMPRODUCT(([Book2.xlsx]Sheet1!$C$4:$C$10000=A8)*([Book2.xlsx]Sheet1!$F$4:$F$10000))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A:ACell ValueduplicatestextNO
A7340:A1048576,A1:A7330Cell ValueduplicatestextNO
A5363:A5647,A5649:A5812,A5822:A7255,A1:A5353,A7257:A7330,A7340:A1048576Cell ValueduplicatestextNO
A9687:A1048576,A1:A9Cell ValueduplicatestextNO
A9687:A1048576,A1:A9Cell ValueduplicatestextNO
A9687:A1048576,A1:A9Cell ValueduplicatestextNO
A1:A5Cell ValueduplicatestextNO
A1:A5Cell ValueduplicatestextNO
A1:A5Cell ValueduplicatestextNO
A1:A5Cell ValueduplicatestextNO
A1:A5Cell ValueduplicatestextNO
A1:A5Cell ValueduplicatestextNO
A1:A5Cell ValueduplicatestextNO
A1:A5Cell ValueduplicatestextNO
A1:A5Dates OccurringyesterdaytextNO
A9687:A1048576,A6:A9Cell ValueduplicatestextNO
A9687:A1048576,A7Cell ValueduplicatestextNO
A9687:A1048576,A7Dates OccurringyesterdaytextNO
A9687:A1048576,A7Cell ValueduplicatestextNO
A9687:A1048576,A7Cell ValueduplicatestextNO
A9687:A1048576,A7Cell ValueduplicatestextNO
A9687:A1048576,A7:A9Cell ValueduplicatestextNO
A10:A11Cell ValueduplicatestextNO
A10:A11Cell ValueduplicatestextNO
A10:A11Cell ValueduplicatestextNO
A6067:A6119,A6121:A7255,A5183:A5353,A5363:A5647,A5649:A5812,A5822:A6064,A12:A5181,A7257:A7330,A7340:A9686Cell ValueduplicatestextNO
A6067:A6119,A6121:A7255,A5183:A5353,A5363:A5647,A5649:A5812,A5822:A6064,A12:A5181,A7257:A7330,A7340:A9686Cell ValueduplicatestextNO
A6067:A6119,A6121:A7255,A5183:A5353,A5363:A5647,A5649:A5812,A5822:A6064,A12:A5181,A7257:A7330,A7340:A9686Cell ValueduplicatestextNO
A6067:A6119,A6121:A7255,A5183:A5353,A5363:A5647,A5649:A5812,A5822:A6064,A1:A5181,A7257:A7330,A7340:A1048576Cell ValueduplicatestextNO
 
Upvote 0
sorry for this but the XL2BBa didnt work with me
&
thats right sum if will do it
but as a told you some times W/O cells Column(in book 2) is duplicated so it will sum atotal of amount of all cell_(W/O)

but i need it two times in amount and date
such as this cell in book 2
212049586
it shows in row 4 and row 214
so sumif will get it as one number as a total
but i want it two numbers and its date

i know this seems to be impossible but if not works
i should do this manulay
and as u see its a lot a lot of work

i hope u under stand me
and sorry for bad language


appreciated
 
Upvote 0
thats why a small sample would be much better

if this does not answer the question - then provide 2 very simple spreadsheets with 10 - 20 rows and expected results as mentioned above -
I filters book2 on

212049586

and got 2 entries
S/N Date W/O Type Invoice Number Amount (S.R) Remarks
4 2023/01/05 212049586 802 2301000996 16,131.80
5 2023/03/02 212049586 801 2301001063 471.00

and not row 4 / 214 -

you mention dates
i dont see any dates in book1

If you just want to sum unique entries

i have just changed the 1st couple of lines to show duplicates
and used

=SUM(UNIQUE(FILTER([Book2.xlsx]Sheet1!$F$4:$F$10000,[Book2.xlsx]Sheet1!$C$4:$C$10000=A8)))

entry in row 4 and 5 on book2
now contains W/O = 132251036
both with a value of 10
so a SUM will add that up to 20
But by using the formula above - it returns 10 and ignores duplicated W/O numbers


Book1.xlsx
ABCDEF
7W/OType Paid Amount Paid Date Paid Amount Paid Date2
8132251036710.00
Sheet1
Cell Formulas
RangeFormula
E8E8=SUM(UNIQUE(FILTER([Book2.xlsx]Sheet1!$F$4:$F$10000,[Book2.xlsx]Sheet1!$C$4:$C$10000=A8)))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A8Cell ValueduplicatestextNO
A1:A7,A9:A1048576Cell ValueduplicatestextNO
A7340:A1048576,A1:A7,A9:A7330Cell ValueduplicatestextNO
A5363:A5647,A5649:A5812,A5822:A7255,A1:A7,A7257:A7330,A7340:A1048576,A9:A5353Cell ValueduplicatestextNO
A9687:A1048576,A1:A7,A9Cell ValueduplicatestextNO
A9687:A1048576,A1:A7,A9Cell ValueduplicatestextNO
A9687:A1048576,A1:A7,A9Cell ValueduplicatestextNO
A9687:A1048576,A6:A7,A9Cell ValueduplicatestextNO
A9687:A1048576,A7Cell ValueduplicatestextNO
A9687:A1048576,A7Dates OccurringyesterdaytextNO
A9687:A1048576,A7Cell ValueduplicatestextNO
A9687:A1048576,A7Cell ValueduplicatestextNO
A9687:A1048576,A7Cell ValueduplicatestextNO
A9687:A1048576,A7,A9Cell ValueduplicatestextNO
A6067:A6119,A6121:A7255,A5183:A5353,A5363:A5647,A5649:A5812,A5822:A6064,A1:A7,A7257:A7330,A7340:A1048576,A9:A5181Cell ValueduplicatestextNO


Book2.xlsx
ABCDEFG
3S/NDateW/OTypeInvoice Number Amount (S.R) Remarks
412023/01/021322510368230100047510.00
512023/01/0513225103685230100049410.00
612023/01/0515208415485230100049430,517.50
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C3:C2342Cell ValueduplicatestextNO
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,186
Members
452,615
Latest member
bogeys2birdies

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