What I am trying to do is concatenate two cells, then check that concatenated value against a column of values, and put an X in a cell if such a value exists. The following equation is what I'm using:
{=IF(CONCATENATE(A2, " ", B2) = 'MasterList'!$C:$C, "x", "")}
Column A is the name of the software and Column B the version number (A="Microsoft .NET Framework 4.5.1", B="4.5.50938", for example). I know that this concatenated value exists on the MasterList worksheet so I don't understand why I'm not getting the answer I expect.
Gurus, what's my flaw here?
The fastest comparison/lookup on the worksheet is a MATCH function. If you have a long column to put this formula into you could try,
=IF(ISNUMBER(MATCH(CONCATENATE(A2, " ", B2), 'MasterList'!$C:$C, 0)), "x", "")
Fill down as necessary.
It seams that you select the entire column C on yout MasterListSheet. Don't you mean just one cell? Like:
=IF(CONCATENATE(A2, " ", B2) = 'MasterList'!$C1, "x", "")
or try to : =IF(CONCATENATE(A2, " ", B2) = MasterList.!$C1, "x", "") (on open Office)
Best thing is instead of you write the Sheet name, let Excel do it for you by editing the formula, remove the sheet name and then with a mouse click navigate to the desired area.
I just want to say that before seeing this question, I had no idea what array formulas were.
I have the following working example:
Sheet1:
A1: Microsoft .NET Framework 4.5.1
B1: 4.5.50938
// press control-shift-enter after typing formula
C4: =IF(CONCATENATE(A1," ",B1)=Sheet2!$A:$A,"YAY","NAY")
Sheet2:
A1: Microsoft .NET Framework 4.5.1 4.5.50938
Not sure what the issue is with your spreadsheet. Do the values in MasterList!$C:$C actually correspond to what you expect as the result of the concatenation?
This is not a valid array formula. The LHS is a single cell while the RHS is an array. What it actually does is compare the concatenation to all cells of columns C in MasterList.
You either need to make it a valid array formula or a normal formula. I recommend the second solution.
For the first solution, it should be:
{=IF(CONCATENATE(A:A, " ",B:B ) ='MasterList'!$C:$C, "x", "")}
However, this will be very slow because it will compute and concatenate two full columns, and moreover you will have to select your whole range where you want to calculate it (a full columns) then press Ctrl+Shift+Enter.
You can make it a simple formula in on cell then copy/paste along your column. Formula for C2:
=IF(CONCATENATE(A2, " ", B2) = 'MasterList'!$C2, "x", "")
I would like to create a formula that sums all the values that I'm going to add in the future in some cells of the same row. For example, I would like to add cells D3,G3,J3,M3 and so on (separated 3 rows) in cell D1.
Best regards,
A good solution will depend on what (if anything) is in the intervening columns on row 3. A SUMPRODUCT function can produce some nice results by checking the stagger or offset of the columns but it isn't going to like text put into the intervening cells.
=SUMPRODUCT((INDEX(3:3, 1, 4):INDEX(3:3, 1, MATCH(1E+99,3:3 )))*NOT(MOD(COLUMN(INDEX(3:3, 1, 4):INDEX(3:3, 1, MATCH(1E+99,3:3 )))-1, 3)))
By switching to an array formula and a condition SUM function, you should be able to happily skip over any text values.
=SUM(IF(NOT(MOD(COLUMN(INDEX(3:3,1,4):INDEX(3:3,1,MATCH(E1+99,3:3)))-1,3)),INDEX(3:3,1,4):INDEX(3:3,1,MATCH(E1+99,3:3))))
Array formulas need to be finalized with Ctrl+Shift+Enter↵.
If neither ot those fits the bill, provide a little more information on the nature of what not to sum and more help can be offered.
This will do the job:
1) put =SUM(D2:XFD2) in cell D1
2) put =IF(MOD(COLUMN(D3)+2,3)=0,IF(D3="","",D3),"") in all cells from (D2 .. til the end)
3) put your data in D3 .... til the end.
Anonymous' solution works if you only need to sum one row. If you need to be able to drag that formula down, consider using a flag in row 2 to identify every 3rd column (like Anonymous did) , and use a sumif formula to add the columns where that flag is present.
Type
=
in the cell where your first result will appear (e.g. D1).
Click on the first value in the first row.
Press + on numpad.
Click on the next value in the next row.
Repeat steps 4-5 until you reach the last row.
Press Enter.
You can now select the results-cell (e.g. D1) and click and drag the small button to your lower right, across all the columns.
If you have a static reference - a constant in a cell that you do not wish to move use the $ operator, for example: $C$3 will not move column-wise or row-wise. $C3 can move column-wise but not row-wise and the opposite is true for C$3. This can be achieved in the Formula Bar, where you can also manually type in the function.
I've been Googling for hours trying to create a COUNTIFS formula that will:
count the unique records in a table range
that have dates that fall within 4 years after
a year in a referenced cell
This is what I have so far: =COUNTIFS(dte_degr_conferred2,"<="&YEAR('Student Success and Progress'!$G$1)+4) but it is not correct and I've tried several variations
Please note: dte_degr_conferred2 column contains dates, 'Student Success and Progress'!$G$1 contains a 4-digit year
Many Thanks
Perhaps you mean this array formula**:
=SUM(IF(FREQUENCY(IF(dte_degr_conferred2<>"",IF(YEAR(dte_degr_conferred2)='Student Success and Progress'!G1,dte_degr_conferred2)),dte_degr_conferred2),1))
Regards
**Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
Trying to work out exactly what you need (you might be overcomplicating). Here is an example of using the COUNTIFS formula to compare dates. This formula was entered into cell E6 with the setup as below:
=COUNTIFS($B$2:$B$6,"<="&E3+4,$B$2:$B$6,">="&E3)
I have an even more simplistic interpretation:
=COUNTIF(dte_degr_conferred2,">="&DATE('Student Success and Progress'!$G$1+4,1,1))
The "count unique" requirement makes this an interesting question.
Here's what I've come up with:
=SUM(
IF(
FREQUENCY(
IF((YEAR(ddc)>=ssp!$G$1) + (YEAR(ddc)<ssp!$G$1+4) = 2, ddc, ""),
IF((YEAR(ddc)>=ssp!$G$1) + (YEAR(ddc)<ssp!$G$1+4) = 2, ddc, "")
)>0,
1
)
)
... where ddc is dte_degr_conferred2 and ssp is 'Student Success and Progress'. (When posting to SO, it's helpful to reduce a question to its essentials, because that makes it easier to respond to, as well as making it more universally useful.)
Enter as an array formula: Ctrl + Shift + Enter
Example
In this example, there are three distinct dates that match the criteria: 05/12/2014, 09/12/2014, and 05/26/2012.
How it works:
When creating array formulas, it can be useful to work out the calculations separately before joining them in an array. I've done so here:
Column C is =(YEAR(A1)>=$B$1) + (YEAR(A1)<$B$1+4) (copied down). In Excel, TRUE is 1 and FALSE is 0, so you can add boolean values together. If A1 is between B1 and B1+4, both operands are TRUE, and TRUE + TRUE = 2.
Column D is =IF(C1=2,A1,"") (copied down). This grabs the data that matches the criteria. (I formatted as numbers to highlight the fact that Excel stores dates as numbers.)
Column E is =SUM(IF(FREQUENCY(D1:D10,D1:D10)>0,1)). For an explanation of this method, see http://office.microsoft.com/en-us/excel-help/count-occurrences-of-values-or-unique-values-in-a-data-range-HP003056118.aspx
My solution at top combines all this into a single array formula.
I have two columns, one "floor", floor can be written as an integer or a string "4-5" means 2 floors between 4F and 5F, then another is price, I need to "SUMPRODUCT" all the price for all floors.
I do not want to use hidden columns to help the calcuate, only one formula in the totle price cell.
have tried find,search,match,vlookup for this but get error #VALUE
this the formula I written in "find".
=SUMPRODUCT(K45:K59,(NOT(ISERROR(INT(H45:H59))))*1)+IF(AND(NOT(ISERROR(FIND("-",H45:H59))),NOT(ISERROR(INT(MID(H45:H59,1,FIND("-",H45:H59)-1)))),NOT(ISERROR(INT(MID(H45:H59,FIND("-",H45:H59)+1,LEN(H45:H59)))))),INT(MID(H45:H59,FIND("-",H45:H59)+1,LEN(H45:H59)))-INT(MID(H45:H59,1,FIND("-",H45:H59)-1))+1,0)
You can use SUMPRODUCT for this:
=SUMPRODUCT(
IF(ISNUMBER(H$45:H$59),
1,
MID(H$45:H$59,FIND("-",H$45:H$59)+1,10)-MID(H$45:H$59,1,FIND("-",H$45:H$59)-1)+1
),
I$45:I$59
)
Enter it as an array formula: Ctrl + Shift + Enter.
Output
I finally gave up the attempt of writing a single smart formula. because the row count of block is fixed, I divide the formula into a long-but-similar formula.
=(IF(AND(NOT(ISERROR(FIND("-",H45))),NOT(ISERROR(INT(MID(H45,1,FIND("-",H45)-1)))),NOT(ISERROR(INT(MID(H45,FIND("-",H45)+1,LEN(H45)))))),(INT(MID(H45,FIND("-",H45)+1,LEN(H45)))-INT(MID(H45,1,FIND("-",H45)-1))+1)*K45,K45))+(IF(AND(NOT(ISERROR(FIND("-",H46))),NOT(ISERROR(INT(MID(H46,1,FIND("-",H46)-1)))),NOT(ISERROR(INT(MID(H46,FIND("-",H46)+1,LEN(H46)))))),(INT(MID(H46,FIND("-",H46)+1,LEN(H46)))-INT(MID(H46,1,FIND("-",H46)-1))+1)*K46,K46))+(IF(AND(NOT(ISERROR(FIND("-",H47))),NOT(ISERROR(INT(MID(H47,1,FIND("-",H47)-1)))),NOT(ISERROR(INT(MID(H47,FIND("-",H47)+1,LEN(H47)))))),(INT(MID(H47,FIND("-",H47)+1,LEN(H47)))-INT(MID(H47,1,FIND("-",H47)-1))+1)*K47,K47))+(IF(AND(NOT(ISERROR(FIND("-",H48))),NOT(ISERROR(INT(MID(H48,1,FIND("-",H48)-1)))),NOT(ISERROR(INT(MID(H48,FIND("-",H48)+1,LEN(H48)))))),(INT(MID(H48,FIND("-",H48)+1,LEN(H48)))-INT(MID(H48,1,FIND("-",H48)-1))+1)*K48,K48))+(IF(AND(NOT(ISERROR(FIND("-",H49))),NOT(ISERROR(INT(MID(H49,1,FIND("-",H49)-1)))),NOT(ISERROR(INT(MID(H49,FIND("-",H49)+1,LEN(H49)))))),(INT(MID(H49,FIND("-",H49)+1,LEN(H49)))-INT(MID(H49,1,FIND("-",H49)-1))+1)*K49,K49))+(IF(AND(NOT(ISERROR(FIND("-",H50))),NOT(ISERROR(INT(MID(H50,1,FIND("-",H50)-1)))),NOT(ISERROR(INT(MID(H50,FIND("-",H50)+1,LEN(H50)))))),(INT(MID(H50,FIND("-",H50)+1,LEN(H50)))-INT(MID(H50,1,FIND("-",H50)-1))+1)*K50,K50))+(IF(AND(NOT(ISERROR(FIND("-",H51))),NOT(ISERROR(INT(MID(H51,1,FIND("-",H51)-1)))),NOT(ISERROR(INT(MID(H51,FIND("-",H51)+1,LEN(H51)))))),(INT(MID(H51,FIND("-",H51)+1,LEN(H51)))-INT(MID(H51,1,FIND("-",H51)-1))+1)*K51,K51))+(IF(AND(NOT(ISERROR(FIND("-",H52))),NOT(ISERROR(INT(MID(H52,1,FIND("-",H52)-1)))),NOT(ISERROR(INT(MID(H52,FIND("-",H52)+1,LEN(H52)))))),(INT(MID(H52,FIND("-",H52)+1,LEN(H52)))-INT(MID(H52,1,FIND("-",H52)-1))+1)*K52,K52))+(IF(AND(NOT(ISERROR(FIND("-",H53))),NOT(ISERROR(INT(MID(H53,1,FIND("-",H53)-1)))),NOT(ISERROR(INT(MID(H53,FIND("-",H53)+1,LEN(H53)))))),(INT(MID(H53,FIND("-",H53)+1,LEN(H53)))-INT(MID(H53,1,FIND("-",H53)-1))+1)*K53,K53))+(IF(AND(NOT(ISERROR(FIND("-",H54))),NOT(ISERROR(INT(MID(H54,1,FIND("-",H54)-1)))),NOT(ISERROR(INT(MID(H54,FIND("-",H54)+1,LEN(H54)))))),(INT(MID(H54,FIND("-",H54)+1,LEN(H54)))-INT(MID(H54,1,FIND("-",H54)-1))+1)*K54,K54))+(IF(AND(NOT(ISERROR(FIND("-",H55))),NOT(ISERROR(INT(MID(H55,1,FIND("-",H55)-1)))),NOT(ISERROR(INT(MID(H55,FIND("-",H55)+1,LEN(H55)))))),(INT(MID(H55,FIND("-",H55)+1,LEN(H55)))-INT(MID(H55,1,FIND("-",H55)-1))+1)*K55,K55))+(IF(AND(NOT(ISERROR(FIND("-",H56))),NOT(ISERROR(INT(MID(H56,1,FIND("-",H56)-1)))),NOT(ISERROR(INT(MID(H56,FIND("-",H56)+1,LEN(H56)))))),(INT(MID(H56,FIND("-",H56)+1,LEN(H56)))-INT(MID(H56,1,FIND("-",H56)-1))+1)*K56,K56))+(IF(AND(NOT(ISERROR(FIND("-",H57))),NOT(ISERROR(INT(MID(H57,1,FIND("-",H57)-1)))),NOT(ISERROR(INT(MID(H57,FIND("-",H57)+1,LEN(H57)))))),(INT(MID(H57,FIND("-",H57)+1,LEN(H57)))-INT(MID(H57,1,FIND("-",H57)-1))+1)*K57,K57))+(IF(AND(NOT(ISERROR(FIND("-",H58))),NOT(ISERROR(INT(MID(H58,1,FIND("-",H58)-1)))),NOT(ISERROR(INT(MID(H58,FIND("-",H58)+1,LEN(H58)))))),(INT(MID(H58,FIND("-",H58)+1,LEN(H58)))-INT(MID(H58,1,FIND("-",H58)-1))+1)*K58,K58))+(IF(AND(NOT(ISERROR(FIND("-",H59))),NOT(ISERROR(INT(MID(H59,1,FIND("-",H59)-1)))),NOT(ISERROR(INT(MID(H59,FIND("-",H59)+1,LEN(H59)))))),(INT(MID(H59,FIND("-",H59)+1,LEN(H59)))-INT(MID(H59,1,FIND("-",H59)-1))+1)*K59,K59))
Longevity, EmployeeID, StartDate, EndDate
I paste a bunch of data into the worksheet (cells B1-Dn), and I need the formula for A1-An (longevity) to automatically calculate the result for each employee that is entered.
I am using Microsoft Excel 2010.
Currently, the formula that I am using is:
=IF ( C1 , IF ( D1 , D1-C1 , TODAY()-C1 ) , "")
This works great, except that I have to manually add/remove cells with this formula in the A column to match the number of rows that are entered at any given time. This is very time-consuming, and difficult for Management to get their heads around when using this report. :)
Is there a way to say "Every row with data in it, gets THIS formula in column A"?
I've been researching this online, and found various answers. The most prominent answer was to use a drop-down-list with a default value, but I don't think that will work for a default formula.
Using Data tables should help you out with ensuring that your formulas cover the entire range.
Step one:
Paste your data (no formulas)
Step two: Go to insert -> table you should get a dialog that looks something like
Now put your formula in the adjacent column. You will notice that the table formatting will automatically expand into where your formula is, and that the formula will auto copy to the bottom of your data set.
Step three:
Copy a larger dataset into the table.... you will notice that the formula copies down with your new extended data set.
Note that the table won't be resized if you paste a smaller dataset.
If I understand correctly what you need, then maybe you should try this.
In the every cell of column A (where you need the formula to be present if other columns contain data) add this formula :
=IF( AND( NOT(ISBLANK(B:B)),NOT(ISBLANK(C:C)),NOT(ISBLANK(D:D)) ),
IF ( $C1 , IF ( $D1 , $D1-$C1 , TODAY()-$C1 ) , ""),"" )
To be more exact, you should add this formula in the A1 cell, and then auto fill all the A column.
Alternatively you could try setting the formula below in A1 cell and then auto fill the rest of the A column.
=IF( AND( NOT(ISBLANK(B1)),NOT(ISBLANK(C1)),NOT(ISBLANK(D1)) ),
IF ( $C1 , IF ( $D1 , $D1-$C1 , TODAY()-$C1 ) , ""),"" )