Want to search text from a group of words and then sum in excel - excel

I have a data as below -
Name Amount
John Martha 20
John ABS 30
Man XYZ 10
Now, I want excel to search John from all rows and sum the value against it.
For example - John - 50

If you'd like to sum all values in column B where corresponding value in column A contains substring John, use this one:
=SUMIF(A1:A10,"*John*",B1:B10)
If you'd like to sum all values in column B where corresponding value in column A starts from John, use this one:
=SUMIF(A1:A10,"John *",B1:B10)
in both formulas range A1:A10 contains names and B1:B10 - amount

Related

Index Match with multiple criteria not working properly?

I have 2 worksheets in an excel workbook.
Data
Column A Column B (PO) Column C (Supplier No) Column D (Item No) Column E(date) Column F (week no)
123406121601 - 555 =LEFT(A1,12) =LEFT(A1,3) =RIGHT(A1,3) 06/12/2016 =WEEKNUM(A1,21)
I have about about 1000 rows of data like the above.
In column A, each cell contains jumbled information consisting of a PO number and item number.
The PO number is the first 12 digits in the cell in column A, and the first 4 digits contain the supplier number.
The PO also is made up of a date, i.e. 123406121601 = a date of 061016 and once formated = 06/12/2016.
My formula's give the results below:
Column A Column B Column C Column D Column E Column F
ABC123409121601 - 555 123409121601 123 555 06/12/2016 49
On the second sheet, Home, i have the following:
Column A Column b Column C Column D Column E
123 555 06/12/2016 {INDEX MATCH FORMULA}
I am wanting to lookup the po number on sheet 2 where the supplier number, item number and date match - using the formula below:
=IF(C1<>"",INDEX(Data!B:B,MATCH(1,(Home!A1=Data!C:C)*(Home!B1=Data!D:D)*(Home!C1=Data!E:E),0)),INDEX(Data!B:B,MATCH(1,(Home!A1=Data!C:C)*(Home!B1=Data!D:D)*(D1=Data!F:F),0)))
Within this formula I have surrounded 2 index match formula's inside an if statement. This means the user can check for a result/PO Number based on the supplier number and item number and a specific date or the week number that date falls within.
For some reason, this index match works fine if im using static values and keeping my rows of data relatively short. However, for some reason, either by using formulas on sheet 'data' or by having more rows of data - this causes me to get the following result
NA!
Please can someone show me where i am going wrong?

Updating a column in excel

I have two excel sheets with one column common for both. I need to match the column value and update the next column by following the excel 2.
for example:
I have excel1 as
A B C D
fruits 22 f.market
vegetables 50 v.market
flowers 60 l.market
excel2
A B
fruits 1000
flowers 2000
So, I need to update column D in excel 1 as 1000 where column A is fruits
You can use VLOOKUP() for fetching the respective value. Considering your data value 'fruits' is in cell A1 try to use following function
=VLOOKUP(A1,$A1$B2,2,false)

INDEX MATCH obtaining values for duplicate names

I have one example table with the following data in Sheet1 with the following random data
------A ----------------- B ----------------------C ------------------------D
1 --First--------------Last-----------------Start Date--------------End Date
2 --John--------------Smith--------------08/08/2014------------01/01/2015
3---John--------------Smith--------------08/11/2014------------17/11/2014
4---John--------------Smith--------------06/06/2014------------23/12/2014
5---Abel--------------Jones--------------14/05/2014------------29/04/2015
6---Abel--------------Jones--------------04/07/2014------------26/04/2015
Then I have another table in Sheet2
------A ----------------- B ----------------------C ------------------------D
1 --First--------------Last-----------------Start Date--------------End Date
2 --John--------------Smith---------------------------------------------------
3---John--------------Smith---------------------------------------------------
4---John--------------Smith---------------------------------------------------
5---Abel--------------Jones---------------------------------------------------
6---Abel--------------Jones---------------------------------------------------
I am using INDEX MATCH to transfer the data between the two sheets.
=INDEX(Sheet1!$C:$C,
MATCH(1,INDEX((Sheet1!$A:$A=$A3)*(Sheet1!$B:$B=$B3),0),0))
To populate column C with the start dates from Sheet1.
=INDEX(Sheet1!$D:$D,
MATCH(1,INDEX((Sheet1!$A:$A=$A3)*(Sheet1!$B:$B=$B3),0),0))
and this to populate column D with the end dates.
The problem is, when I perform this INDEX MATCH function, for a duplicate name, it will only copy over the first value. So this formula will paste 08/08/2014 into all 'John Smith' Start dates in column C of Sheet2.
How do I obtain all values so that C2 should be 08/08/2014, C3 should be 08/11/2014, C4 should be 06/06/2014 etc.
One solution would be to insert a column in both sheets with a "running count" of instances of the same name. For example, insert col C and in C2 enter =IF(A2&B2 = A1&B1, C1+1, 1). This starts the count at 1 if the concatenated first and last name is new, and increases the previous count by 1 if not. So you would have
First Last Count by Person
John Smith 1
John Smith 2
John Smith 3
Abel Jones 1
Abel Jones 2
George Washington 1
Thomas Jefferson 1
Thomas Jefferson 2
You can then add this column to your MATCH() function (and change the lookup column as necessary).
Edit: It is worth noting that this requires your raw data is sorted by name.
You can narrow the $A:$A refferances to something like $Ax+1:$Ay where y = last row of your excel sheet and x is position of previous occurance of this name/surname (you could store this in some dummy column).

How to SUM parts of a column which have same text value in different column in the same row

I have a column with names and a column with numbers:
FirstName Name Number
John Smith 17
John Smith 26
Peter Smith 116
Peter Smith 25
Franck Black 17
Luke Peterson 17
Luke Peterson 37
Names with same FirstName and Name represent the same person. I need to sum the numbers associated with them. I prefer not to use VBA.
A PivotTable might suit, though I am not quite certain of the layout of your data:
The bold numbers (one of each pair of duplicates) need not be shown as the field does not have to be subtotalled eg:
This can be done by using SUMPRODUCT as well. Update the ranges as you see fit
=SUMPRODUCT(($A$2:$A$7=A2)*($B$2:$B$7=B2)*$C$2:$C$7)
A2:A7 = First name range
B2:B7 = Last Name Range
C2:C7 = Numbers Range
This will find all the names with the same first and last name and sum the numbers in your numbers column
If your data has the names grouped as shown then you can use this formula in D2 copied down to get a total against the last entry for each name
=IF((A2=A3)*(B2=B3),"",SUM(C$2:C2)-SUM(D$1:D1))
See screenshot

Excel macro/formula - replace cell values if value does NOT appear in another column

I need help. I have a list of 20 names of certain consultants. I receive a new sheet daily with many names, and if one of them does not match with any of the 20 consultant names, I need to replace the cell value with "X".
E.g.
1. Consultant's list contains John and Mary.
2. Daily list contains 5 names: John, Steve, Dean, Mary and Sue.
3. I now want to replace all the cell which does NOT contain John and Mary with X (thus replace cell with names Steve, Dean and Sue with X)
Help will be appreciated
If your 20-name list is in ColumnA and the daily list in ColumnB each starting in Row1 then in Row 1 and copied down to suit:
=IF(ISERROR(MATCH(B1,A:A,0)),"X",B1)

Resources