On a spreadsheet what does A:A and !A:A mean? - spreadsheet

I have come across this sumif formula, I cant find any help doing a Google search on the N:N
=sumif(N:N,"Cat",C:C)
So I understand the SumIf, as per the docs:
SUMIF(range, criterion, [sum_range])
But I don't fully understand the N:N. Also please explain !A:A
Can someone provide an official explanation or point me to the docs.

N:N means that the range includes the whole column N, rather than just certain cells (e.g. N1:N300). This allows a formula to reference all data in the column even if you add more rows later on.
The exclamation mark is explained here: What does an exclamation mark before a cell reference mean?
When entered as the reference of a Named range, it refers to range on the sheet the named range is used on.
For example, create a named range MyName refering to =SUM(!B1:!K1)
Place a formula on Sheet1 =MyName. This will sum Sheet1!B1:K1
Now place the same formula (=MyName) on Sheet2. That formula will sum Sheet2!B1:K1
Note: (as pnuts commented) this and the regular SheetName!B1:K1 format are relative, so reference different cells as the =MyName formula is entered into different cells.

A clear answer to N:N was given. For the rest..
The exclamation mark in !A:A just means that you refer to another spreadsheet in your workbook -> say you currently work in Sheet2 and want to get Data from Sheet1. for this you have to use Sheet1 !A:A

Related

VLookup table array from another sheet

Ive a sheet in which a cell value to be dynamically changed based on the cell value in the same row. So we have to pick that cell value first and then use that value to search in another sheet. Here is the code I have got. The sheet I have to search is Mapper
ActiveSheet.Range("P2").Select
formularwcount = ActiveSheet.UsedRange.Rows.Count
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-11], Mapper!C[-13]:C[2],3,FALSE)"
In this code they are using R1C1 convention which I didnt understand what they mean by putting Mapper!C[-13]:C[2] there as the table array. Im only a 10 days old developer with VBA. Anyone please tell what does that mean.
I found this information by Googling "R1C1":
Cell References
In place of a named cell, an alternative approach is to use a cell (or grid) reference. Most cell references indicate another cell in the same spreadsheet, but a cell reference can also refer to a cell in a different sheet within the same spreadsheet, or (depending on the implementation) to a cell in another spreadsheet entirely, or to a value from a remote application.
A typical cell reference in "A1" style consists of one or two case-insensitive letters to identify the column (if there are up to 256 columns: A–Z and AA–IV) followed by a row number (e.g., in the range 1–65536). Either part can be relative (it changes when the formula it is in is moved or copied), or absolute (indicated with $ in front of the part concerned of the cell reference).
The alternative "R1C1" reference style consists of the letter R, the row number, the letter C, and the column number; relative row or column numbers are indicated by enclosing the number in square brackets. Most current spreadsheets use the A1 style, some providing the R1C1 style as a compatibility option.
Source: Wikipedia: Spreadsheets

Named Cells and Formulas In Excel

How do I utilize named cell references in Excel that aren't absolute. I want to be able to take a formula and be able to drag it across excel and have one name cell reference update to a different named cell as I move across.
For example: I want to keep RevenuePerStay going across the formulas row and have excel updated the cell reference to the number of people staying. So
400 should be RevenuePerStay * Stay400
600 should be `RevenuePerStay * Stay600`
I tried using mixed cell reference and relative cell references using the dollar sign but excel will not accept this.
Assuming your stays are in row 5:
For this worksheet, click on cell C7 and go to create a new named range called Stays and for the formula write =C$5$ and exit the name manager.
Now change your formula in C7 to being RevenuePerStay*Stays and drag it across. This will get the right amount of stays you want each time.
In explicit answer to your question: no you would never get the name in the formula to change unless you put all scenarios in the formula using multiple if statements.
If I understand your question correctly, this method seems convoluted because you can use =RevenuePerStay*C5 and drag over the row, and it should give the answer you want.
If you really want to take the advantage of named range and make it change dynamically, you will need to incorporate with INDIRECT like this:
=RevenuePerStay*INDIRECT("Stay"&C5)
But this is assuming you have all the named ranges defined properly such as Stay200, Stay400, Stay600, Stay800, Stay1000 like below. Otherwise it will not work.

Vlookup with three comments depends on found value vba code or formula ( very hard to find solution)

I have very difficult scenario where i need to mention three comments by tow V lookup. let me explain you situation.
We are getting three sheets in workbook with values every weekly.
sheet1 range A1 to A5 value , lookup values sheet2 range A:B and lookup value sheet3 range A:B. yes i can able to put two V lookup , but problem is 3 comments i need to show in single output.
When i lookup values found in sheet2 need comment as "found value in sheet2" , if not it has to lookup sheet3 range if found then it has to give comment as "found value in sheet3" and if value not found need to give comment as " invalid data".
through vba can is it possible and three comments should be sheet1 in a single output based on values?
am looked in google i can use IFSA formula and apply formula but i cant provide three comments ...
For us its really hard every weekend , Please help me with VBA Code or Any formula at one shot for three comments ?
Really appreciate your help
You can actually have up to 7 Nested (IF) functions in Excel - Nested Formula Limit
You need to make sure that you properly close each function. This can be seen when editing the formula, it will highlight the opening/closing parentheses as you arrow through the formula.
If it tries to select a range while using the arrow keys, hit F2 to toggle between Edit/Enter modes.
I think you want this...
=IF(ISNA(VLOOKUP(A1,Sheet1!A1:B4,2,FALSE)),IF(ISNA(VLOOKUP(A1,Sheet2!A1:B4,2,FALSE)),IF(ISNA(VLOOKUP(A1,Sheet3!A1:B4,2,FALSE)),"Invalid Data", "Sheet 3"),"Sheet2"),"Sheet1")
Actually, on second thought, I assume you want whatever is in Column B
=IFNA(VLOOKUP(A1,Sheet1!A1:B4,2,FALSE),IFNA(VLOOKUP(A1,Sheet2!A1:B4,2,FALSE),IFNA(VLOOKUP(A1,Sheet3!A1:B4,2,FALSE),"Invalid Data")))
If I understand correctly, you need to determine if the first VLOOKUP is found, and if not, use the second VLOOKUP. Thats super simple. Assuming the formula Profex provided doesn't work:
=IF(IFERROR(VLOOKUP("A1", Sheet2!A1:B4, 2, False), "Err")="Err",IFERROR(VLOOKUP("A1", Sheet3!A1:B4, 2, False), "Not Found"), VLOOKUP("A1", Sheet2!A1:B4, 2, False))

Excel Cell reference that will go to the left

I am using an excel spreadsheet formula to add two cells together and I want to have it reference one row from left to right like it normally does, but I need it to reference the same row in another page in reverse, and then be able to drag the formula through the entire worksheet. I cannot seem to find anything like this when I look online. TLDR I need to know how to tell excel reference the cell to the left if I drag it to the right.
so I need to add A0 in page one and A9 in page two then when I copy the formula to the left I need it to grab A1 and A8, is there a way to get this?
Your question is not very clear; for example, you talk about a formula but have an Excel-VBA tag. However, I think I understand the effect you seek.
I have filled A1:I1 of the current sheet and A1:I1 of worksheet “Sheet3” with numbers.
I have typed the following formula into another cell within the current worksheet:
=A1+INDEX(Sheet3!$A$1:$I$1,,10-COLUMN(A1))
The target area for the INDEX function is Sheet3!$A$1:$I$1. This is a one row range so I do not need a row number. The column number is 10-COLUMN(A1) which is 9 so this formula is equivalent to:
=A1+Sheet3!I9
If I copy the formula one cell to the right I get:
=B1+INDEX(Sheet3!$A$1:$I$1,,10-COLUMN(B1))
This is the equivalent of:
=B1+Sheet3!H9
You can continue copying the formula to the right until you get:
=I1+INDEX(Sheet3!$A$1:$I$1,,10-COLUMN(I1))
Attempting to copy further gives an error because 10-COLUMN(J1) is zero and there is no column 0.
There are other methods of achieving this effect. The key feature of any such method is the expression N-X where N is a constant and X gets bigger as the formula is copied further to the right.

MS Excel dynamic print area

I wish to create a dynamic Print_Area in Excel 2010 which will consist of two cell ranges.
For example the first cell range is A1:J50 and the second range is A100:J150. These should print out on two pages, ignoring the cells that come in between these two ranges.
The four cells shown in the above example ranges should be dynamic, and not hard coded as simple Print_Area ranges. Therefore in my worksheet I used cells AA1, AB1, AC1 and AD1 to store values "A1", "J50", "A100" and "J150" respectively.
(The cells AA1, AB1, AC1 and AD1 actually use formulas to determine what cell address will be used, but for this question lets just assume the values are set as above).
I then used the Name Manager and entered the following formula under Print_Area:
=INDIRECT(Sheet1!$AA$1):INDIRECT(Sheet1!$AB$1);INDIRECT(Sheet1!$AC$1):INDIRECT(Sheet1!$AD$1)
The result of this formula is exactly what I need, and it actually works the first time I print the ranges. However once I did that, Excel automatically substitutes the formula with the actual cell range that was calculated. So when I check the Print_Area in the Name Manager after printing once, it contains something like:
=Sheet1!$A$1:$J$50,Sheet1!$A$100:$J$150
Is there a way to prevent the Print_Area from converting my formula to calculated values, and instead using the formula every time I print? I would like to not use macros if at all possible (if not, I'll try macros too)
I tested this and it seemed to work.
Create a new name called Test and set its value to (Note that I used a comma rather than the semicolon you had. I have US language set)
=INDIRECT(Sheet1!$AA$1):INDIRECT(Sheet1!$AA$2),INDIRECT(Sheet1!$AA$3):INDIRECT(Sheet1!$AA$4)
Set your Print_Area name to
=TEST
Good luck!
EDIT
The above works for me, but it appears unnecessary. I just tried to replicate the problem, and was unable. When I have the Print_Area set to the formula with INDIRECT it does not replace after printing.
See this linked file. https://www.dropbox.com/s/pgm0iv19u6igdm5/Book1.xlsx