I have two sheets in Excel.
On one sheet I would like to have a function which validates the second sheet.
Attached screenshot for better understanding:
EDIT: I am using it like this and it works: =IF(AND(ISBLANK(ABS!P4),ISBLANK(ABS!P35),ISBLANK(ABS!P38),ISBLANK(ABS!P43),ISBLANK(ABS!P49),ISBLANK(ABS!P53),ISBLANK(ABS!P54),ISBLANK(ABS!P55),ISBLANK(ABS!P71),ISBLANK(ABS!P76),ISBLANK(ABS!P77),"Not Done","Done")
You can use the COUNTBLANK() function like this:
=IF(COUNTBLANK(Sheet1!A1:A10)>0,"No","Yes")
Related
I am trying to recreate the output I get from this formula from a google sheet in excel.
So currently I have one sheet with a list of staff names in google sheets. Then in another sheet I am using the formula: =ARRAY_CONSTRAIN(ARRAYFORMULA('2 - Staff Listing'!D9:D300), 292, 1) to pull the list of names into a column in the new sheet.
I then used the formula: =ARRAYFORMULA(flatten(B5:B100&A1:J1)) and the output resulted in a column which repeats each name from the first column 10 times. The image below shows the output in google sheets.
Picture of Google Sheet Output
However, I have not found a way to do this in excel yet as it does not have a flatten() function. I have seen some things online about using dynamic array formulas to imitate the flatten() function but the examples weren't very helpful and I couldn't figure out how to implement in for my use case.
If anyone has any ideas for a formula in excel that can accomplish the same thing without extra helper columns for something like a Vlookup I would really appreciate it!
A way:
=IFERROR(INDEX(B2:B5,QUOTIENT(ROW(AZ2:AZ200)-2,10)+1),"")
In B2:B5 have names, you can modify ranges with necessary values.
edit
with SEQUENCE instead of ROWand counting names
=INDEX(B2:B5,QUOTIENT(SEQUENCE(COUNTA(B2:B5)*10)-1,10)+1)
I am trying to join different lists that have less than 3 values on it, there is an example
.
I was able to do it using macros, but I wanted something more automated because these lists updated quite often, is there a way of doing something like that just by using formulas? If no, is there a way of doing it using VBA but in a better way than "clicking" buttons?
Answering VBasic2008:
I am new to this intermediary/advanced excel functions. I just realized that my Macro didn't work. It does not matter where the results will be, could just be at the end of the table. I have around 20 columns.
Basically, I tried to make something that checks if the number of values in the column is below 3 and if it is it would take this list and paste on the "Group X", but I am trying to use just functions to do that, I was able to make a list with all the columns using INDEX + MOD, but it took all of the names, from AAA to the last one, and I wanted something that would take just the list with less than 3 values.
Some update:
=INDEX(IF($F$11:$J$11=3;$F$6:$J$9;"");MOD(ROW()-ROW($O$6);4)+1;INT((ROW()-ROW($O$6))/4)+1)
I was able to come up with this formula, but everything appears with some spaces.
Thanks,
Matheus
Doing this with formulas is possible, but quite advanced. Someone here will write a formula for you which you may not be able to maintain when your scenario changes.
If you already have VBA code that does what you need doing, then you can move that code to an event procedure that starts automatically when a new value is added to the columns.
The event you need is the Worksheet_Change event and it lives in the Sheet module (right-click the sheet and click "View Code". That will show the Sheet module.
In your scenario, you want to run the code when a value is changed in columns D to G, so your code must start with something like
Private Sub Worksheet_Change(ByVal Target As Range)
' run only when a value in columns D to G are changed
If Not Intersect(Target, Range("D:G")) Is Nothing Then
' your code goes here
MsgBox "You just changed a value in one of the the watched columns!"
End If
End Sub
Edit after additional requirements
If you have Office 365 with the new Dynamic Array functions, this formula approach will work.
Building on your index formula, I made a small change. You can use the modified index formula in a helper column. Then use the Filter() function on the values returned by the Index formulas.
Index formula in cell J4 and copied down to J23
=INDEX(IF($D$11:$H$11=3,$D$4:$H$7,"#"),MOD(ROW()-ROW($J$4),4)+1,INT((ROW()-ROW($J$4))/4)+1)
Filter formula in K4
=FILTER(J4:J23,(J4:J23<>"#")*(J4:J23<>0))
If I understand you correctly, try the following:
I put the formula to count the number of entries in row 2, to make it easier to add items below.
I assumed you mean three or less; and not less than three.
If you have Windows O365, you can use the following formulas: (and change the 100 to the lowest possible row)
D2: =COUNTA(D$4:D$100)
and fill right for the number of columns
I4: =FILTERXML("<t><s>" & TEXTJOIN("</s><s>",TRUE,FILTER($D$4:$G$100,$D$2:$G$2<=3)) &"</s></t>","//s")
My Excel-Workbook contains a number of sheets which each contain simulation data. The first sheet however, will be used to aggregate averages over all simulations. Each sheet contains the data of a single simulation.
Now what I would like to do is to have a single reference in which I can enter the names of all simulation sheets and then use this reference in all other charts / tables to perform things like calculating averages over all the sheets.
What I got so far is this:
=AVERAGE('Simulation 1:Simulation 2:Simulation 3'!C2:C8)
However, I have many of these cells and I frequently add new simulation sheets. Therefore I don't want to maintain every single cell like this. Instead I would like to have a single cell in which I maintain the sheets that are used. I tried this:
'Simulation 1:Simulation 2:Simulation 3'
This cell has the text "'Simulation 1:Simulation 2:Simulation 3'" as plain text. I created a name called "EnabledSheets" on the cell and altered the other cells to:
=AVERAGE(EnabledSheets!D2:D8)
This does not work however. Does anyone know a way to make this work? I really have many sheets and their number changes very frequently...
Thank you!
I would create two bracketting sheets.....alpha and omega and place all your actual data sheets between these.
Then a formula like:
=AVERAGE(alpha:omega!A1)
would require no adjustment as data sheets are added or removed.
So this works:
=IF(OR(D2="MEXICO",D2="TURKEY",D2="CHINA",D2="BRAZIL",D2="INDIA",D2="INDONESIA",D2="POLAND",D2="COLOMBIA",D2="ARGENTINA",D2="PHILIPPINES"),D2,"Others")
But this doesn't
=IF(D2=OR("MEXICO","TURKEY","CHINA","BRAZIL","INDIA","INDONESIA","POLAND","COLOMBIA","ARGENTINA","PHILIPPINES"),D2,"Others")
Is there a way to get around writing D2= inside every single time? I am looking to see if the criteria can be used in multiple places .. say in a different sheet I also have country names, but just not in column "D".
You can use something like this:
=IF(ISERROR(VLOOKUP(D2,{"MEXICO","TURKEY"},1,0)),"Others",D2)
Futhermore, as #barryhoudini suggest, in excel 2007 or later you can use:
=IFERROR(VLOOKUP(D2,{"MEXICO","TURKEY"},1,0),"Others")
I would suggest that you create a list of country names in a column in a sheet somewhere and use that as a look up where ever you need it. You can create a separate sheet with this data, say datasheet.
Let's say you have a list of countries in A1:A25 of datasheet, you can then do something like this:
=IF(COUNTIF(datasheet!A1:datasheet!A25, D2) <> 0, D2, "Other")
Additionally, I would create a named range for the set of country names if I expect them to change in the future. This way my formulas will refer to the name and if I add countries I do not have to change the formulas.
It's possible to use OR but you need to change the syntax a little - like this
=IF(OR(D2={"MEXICO","TURKEY","CHINA","BRAZIL","INDIA","INDONESIA","POLAND","COLOMBIA","ARGENTINA","PHILIPPINES"}),D2,"Others")
Alternatively, this should work for you:
=IF(ISNA(MATCH(D2, {"MEXICO","TURKEY","CHINA","BRAZIL","INDIA","INDONESIA","POLAND","COLOMBIA","ARGENTINA","PHILIPPINES"}, 0)), "Others", D2)
As the questions states, I'm trying to reference some cells from one sheet to another. In one sheet I have the Data to populate some other cells in my Principal sheet
In short: DataSheet > Feeds > PrincipalSheet
I'm trying something like:
"=Data!$A$1"
I've even tried something like:
"=[Book1]Data!$A$1"
But still, I can't find the correct code.
I have SpreadSheetGeat 2010 and using C#
Thanks in advance for the help you provide!!
Find the answer, actually, the formula is OK, I was generating the cell ranges with some manual, over the top code, and all that I needed was to put
MySheet.Cells[add ranges here].Range.ToString();
With this code, SpreadSheet generates automatically in which range you are on in this format : "=[Book1]Data!$A$1", and is based on the range that you put in .Cells[],
For some reason Spreadsheet gear adds "[Book1]" when I try the following code. It didn't seem to work in excel.
MySheet.Cells[add ranges here].Range.ToString();
So I manually set the formula Like so:
cells[ rowIndex, 2 ].Formula = "=IFERROR('MySheet1'!$E$6,0)";