Excel formula to prevent duplicate name entries - excel

I am creating a work chart for a project with excel table. However with so many people to manage I have ran into an issue of often putting same person twice on different columns of the same row (he/she can't work on two places at same time!)
So, I am looking for help with a formula that notices if the same name appears twice on a row but does not count multiple blank cells as duplicates. My understanding of excel is very basic and so far I have managed to get this far
=COUNTIF(A6:W6;A6:W6)=1
which returns to me with false, which I assume is because of the blank, unfilled cells still within the table being counted as duplicates.
Help would be appreciated, thanks.

You can't have a range as the second argument of a Countif. The range you pass into the formula will resolve to just the first value. Use the Evaluate Formula tool to see what I mean.
If you want to determine if ANY name in the range A1:W1 appears more than once (and exclude blanks), you will need a recursive function. That can only be done with VBA, not with a formula.
You could use a Countif in a conditional format to highlight duplicate names in a row. That's a piece of cake. Pipe up if you want to do that.

Related

Excel Summing Multiple Cells Based Off Row & Column Indicators

So, what I have is an excel sheet that is automatically generated by a program, so reformat is not an option:
Example Worksheet
General format of this excel will stay the same, with some additional rows depending on the day.
I’m trying to create a formula that I will use from another worksheet (I can handle linking from another workbook) that will give the total number of Boxes for that day.
For example, the correct answer for this day would be 85.
I have tried a few formulas but they have not worked for me.. I am most likely missing something. I tried getting all numbers relative to the “Totals:” cells, and just distinguishing the “* Box” columns with SUMIF but that didn’t work either.
Ideally: Have the formula look at cells in the same row as the “Totals:” rows(blue), but only in the Box Columns(orange) to pinpoint all the (green) cells and add them all up for a grand total.
Colors were just added for visual reference.
Any help is appreciated.
Try this. There may be a way to make it more compact, but I have tested and this works if your columns do not change
=SUMIF(A:A,"Totals:",I:I)+SUMIF(A:A,"Totals:",K:K)+SUMIF(A:A,"Totals:",M:M)+SUMIF(A:A,"Totals:",O:O)+SUMIF(A:A,"Totals:",Q:Q)+SUMIF(A:A,"Totals:",S:S)
After a quick test something this might work (as an array formula):

Excel SUMIFS Formula

I am using the Excel SUMIFS formulas to look for certain item numbers and add that value to the sum. The issue I am having is that many of our item numbers are very close to each other, i.e. 52000135890001 & 52000135890002.
The issue I am having is that the SUMIFS function seems to see these two items as the same value, and is suming them together. I want them added separately, as to us, they are essentially two different items.
I have tried changing the data type for the item numbers to every possible option but the formulas continues to group these together when performing the function.
Does anyone have any ideas how I can still use the SUMIFS formula but somehow tell it to see these two items as different, instead of adding them together under the same criteria?
I am at a loss and losing my mind so any advice would be beyond helpful!
Kyle
You format all your required cells (range cells, criteria and sum_range cells) to custom format as ##################', then apply the sumif it will work by using the right value.

Converting IF statements for use in SUMIF/COUNTIF [or conditional formatting] Excel

I've been trying to get to grips with SUMIF & COUNTIF functions in Excel recently, with limited success. I've realised the crux of the problem is that help pages give far too specific examples, including the official Office support.
I already know how to put together complex tests with multiple criteria already, using IF statements. What I really need is a guide to how to convert IF statements for use in such functions.
The real issue for me is what happens to cell references? I have a column of cells, each with some value for a given property. With an IF function I can go into the adjacent column, test the neighbouring cell using some criterion or set of criteria to find its value for a given property, and return an appropriate answer. I click and drag my formula down to check all the cells.
Eg. A1:A10 are the cells I'm testing. The property I'm checking is their length, whose value will be the number of characters. The appropriate answer will be whether the number of characters is above or below a threshold.
Put together; IF(LEN(A1)>50,"above","below")
Pasted into B1 and dragged down to B10 I get an array of answers.
Suppose I want to count all the cells which meet the condition, that's where I'm stumped. COUNTIF looks like I could just specify the range (A1:A10) and condition LEN(A1)>50 and get my answers. But what do I put inside LEN()? I want to go through and check for each cell in the range, how can I specify just one? Specifying none: LEN() or the range LEN(A1:A10) won't work.
For highlighting cells (conditional formatting), it's easy, just put the top left cell of the array, so LEN(A1), but that doesn't work either!
I hope that's made the problem clear. Obviously I could just have
IF(LEN(A1)>50,1,0) in B1:B10, and SUM(B1:B10) in C1 or something, thus counting all the cells which match the criteria in the if statement. But that seems like a totally retrograde step which negates the benefits of COUNTIF entirely. Namely that it saves space and reduces complexity in the sheet by doing away with intermediate steps.
And I have at least 1 sheet for which that definitely won't work owing to the volatile nature of my array sizes; I wouldn't be able to fit the additional intermediate columns if I wanted to!
SO, can any IF-statement-style check be converted to work with COUNTIF/SUMIF, if so then how, and are there any other tips you could include in case someone with a similar problem comes searching? Thanks so much for answers and help!
Use SUMPRODUCT:
=SUMPRODUCT(1*(LEN(A1:A10)>50))
COUNTIF/SUMIF do not like it when you try to modify the range to be tested. You can do a lot with the criteria, but not the range. It is what is given up to use it in a non array form.

Copying cells from one worksheet to another if a column matches a value

I'm trying to use formula to copy data from one worksheet to another where a column matches a certain value.
To be more specific, I want Working!A2:E100 to contain Data!A2:E100 but only for those rows where Data!C2:100 contains the value "Fixed".
Doing this with leaving blank rows is simple, I just create the formula:
=IF(Data!$C2="Fixed", Data!A2, "")
And copy that formula across all the cells.
But then I thought I'd get clever and have it not copy across blank lines, and entered a maze of unclear excel tutorials and vague error messages.
I've created this formula:
=INDEX(Data!A2:Data!A200, MATCH("Fixed", Data!$C$1:Data!$C$200, 0))
And entered it as an array formula using ctrl shift enter.
However all I get is the contents of Data!A2 repeated over and over in every cell of my spreadsheet.
Does anyone need to know what I need to do to make this work?
This is my attempt at a local prototype following the example in BruceWayne's answer, the results are visible:
As you can see "Row 2" just appears repeatedly in the result column. Excel doesn't seem to have an easy way to see what version it is any more but this seems to be a pretty recent one, it's got the ribbon with the file menu and all menu headings are capitalized.
Here's a formula you can use (note: enter this as an array):
=IFERROR(INDEX(A$1:A$200,SMALL(IF(C$1:C$200="Fixed",ROW(A$1:A$200)-ROW(A$1)+1),ROWS(A$1:A1))),"")
You may need to tweak the ranges, I think I got them to match yours, but again, probably need to tweak. You can then drag this down, and it'll fill in with the values from column A, skipping any blanks.
Edit: Here's a screenshot to (hopefully) help show what I did:
You can edit the ranges, naturally, to be over two sheets.
To clarify, A$1:A$200 is the range of what you want to return (the index). C$1:C$200 is the range that holds "Fixed".

Using nesting vlookup formulas for use in automation code

I am trying to write a formula that uses different vlookups depending on whether the formulas produce errors or not. I have 3 tabs, each with 3 columns.the first two columns contain values that are in the vlookup, with the third colum containing the value I want to find. Basically i want a formula that will use different vlookups depending on whether the lookup value is found in teh first tab or the second . Below is the formula i am working with. It works to bring in values from Sheet1 into Sheet3, but doesnt work when the values are in Sheet2. Also will be inserting this formula into vba code for automation use.
=IF(OR(ISERROR(VLOOKUP(B2,Sheet1!B2:C19,2,FALSE)),ISBLANK(VLOOKUP(Sheet3!B2,Sheet1!B1:C19,2,FALSE))),IF(OR(ISERROR(VLOOKUP(Sheet3!A2,Sheet1!A1:C19,3,FALSE)),ISBLANK(VLOOKUP(Sheet3!A2,Sheet1!A1:C19,3,FALSE))),IF(OR(ISERROR(VLOOKUP(Sheet3!B2,Sheet2!B1:C21,2,FALSE)),ISBLANK(VLOOKUP(Sheet3!B2,Sheet2!B1:C21,2,FALSE))),IF(OR((ISERROR(VLOOKUP(Sheet3!A2,Sheet2!A1:C21,3,FALSE))),ISBLANK(VLOOKUP(Sheet3!A2,Sheet2!A1:C21,3,FALSE))),"non",VLOOKUP(Sheet3!A2,Sheet2!A1:C21,3,FALSE)),VLOOKUP(Sheet3!B2,Sheet2!B1:C21,2,FALSE)),VLOOKUP(Sheet3!A2,Sheet1!A1:C19,3,FALSE)),VLOOKUP(Sheet3!B2,Sheet1!B1:C19,2,FALSE))
it returns the value sI am looking for up until the lookup values start occuring in Sheet2. At that point it shows me "non".
Any help would be greatly appreciated! Thanks
Your first VLOOKUP does not reference "Sheet3".
I think The below equation does what you are looking to do (assumes you are on Sheet3).
=IF(IFERROR(VLOOKUP($B$1,Sheet1!A:C,3,FALSE),"")="",IF(IFERROR(VLOOKUP($B$1,Sheet1!B:C,2,FALSE),"")="",IF(IFERROR(VLOOKUP($B$2,Sheet2!B:C,2,FALSE),"")="",IF(IFERROR(VLOOKUP($B$2,Sheet2!A:C,3,FALSE),"")="","nan",VLOOKUP($B$2,Sheet2!A:C,3,FALSE)),VLOOKUP($B$2,Sheet2!B:C,2,FALSE)),VLOOKUP($B$1,Sheet1!B:C,2,FALSE)),VLOOKUP($B$1,Sheet1!A:C,3,FALSE))

Resources