i have this formula =IFERROR(VLOOKUP(H4,Names!A:Q,16,0),"N/A") it works but only takes the top cell value and i need it to add up all cells in the row matching the value in "H4"
table extracting data from
table extracting data too, where the formula in question is used
here is the example, i need the rows connecting to "mac" to add together in a separate table cell eg: 19:00 = 31, 20:00 = 38
can anyone help with this?
Try this,
=sumifs(p:p, a:a, h4)
By the looks of it, you have merged cells in Names!A:A - so have brought problems on yourself. One solution is to unmerge (and avoid ever merging anything ever again!) and if you only want each Name to be shown the one time fill in the other instances but avoid displaying them (such as by blending the font colour into the background colour - such as with Conditional Formatting).
The filling in is easy with the technique here.
Then #Jeeped's solution should serve, provided you qualify the ranges with the sheet name:
=SUMIFS(Names!P:P,Names!A:A,H4)
Related
Recently I have struggled to solve one problem regarding Transposing the data from vertical to horizontal, Following the filter rows pattern.
So I have created A table with a few variables, I want to transfer the data so that it follows the next pattern: First name - Lucky Number - First name - Lucky Number, etc...
This is quite easy when the filters are off,
I would type some random letter (in this case h) following the Cell number, and then I would drag the data to the right:
In the following example, I had to populate two cells ( first: hC1 second: hB1) I would select these two cells and would drag the cursor to the right, and Excel would recognize it and would follow the pattern, But With the filter on (Column Cool only YES answer displayed), it does not follow the pattern of filtered rows, so I was wondering is there a method to make excel follow the Filtered Rows?
Please try using anyone of the either formulas depending on your Excel Version
• Formula used in cell E13
=IFERROR(INDEX($A$2:$B$11,AGGREGATE(15,6,(ROW($D$2:$D$11)-ROW($D$2)+1)/
(($D$2:$D$11="YES")*(SUBTOTAL(3,OFFSET($D$2:$D$11,ROW($D$2:$D$11)-ROW($D$2),0,1))>0)),
INT((COLUMN(A1)-1)/2)+1),MOD(COLUMNS($A$1:A1)-2,2)+1),"")
The above formula, works for all versions of Excel, but needs to commit with CTRL+SHIFT+ENTER and fill right!
Perhaps, if you are using MS365/Excel 2021 then you may try the below formula as well,
=LET(Cool,$D$2:$D$11,
flist,SUBTOTAL(3,OFFSET(Cool,ROW(Cool)-ROW($D$2),0,1)),
array,FILTER($A$2:$B$11,((Cool="YES")*(flist>0)),""),
INDEX(array,INT((COLUMN(A1)-1)/2)+1,MOD(COLUMNS($A$1:A1)-2,2)+1))
I have been struggling with these two problems for the better part of the day. Please see this link to an example: https://docs.google.com/spreadsheets/d/1odU7oqc-WviLzQcghkbYbQG-4DC70-Q_hszb22Chljw/edit?usp=sharing
This is a simplified document I use to see which lecturer (name) has has added which of the 5 documents (on the right) to an online learning environment (one row for each course). The courses can be given in semester 1, 2, or in both. I want to use this document to automatically highlight a name if any of the five boxes on the right is empty if the semester I want to check (Cell D1) is similar to Column E. Furthermore, only the first time a name appears in red, should the e-mail appear so as well.
For this, I of course use conditional formatting (please see those formulas, also pasted in column M (range column C and D) and N (Range column D). N is the white conditional formatting overruling M, in which a N="TRUE" means it is whitened out).
Example 1 (Ans) shows how I intend the programme to work. The first instance shows shows both the name and e-mail in red, later instances do too unless the semester is not similar or all boxes on the right are ticked.
Example 2 (Bertrand) shows the first problem. If the first instance of a red name and e-mail occurs in a semester 'both', the second time the name should be red the e-mail does so as well. This keep occurring until a semester is similar to Cell D1, after which it is normal again.
Example 3 (Carel) shows the second problem. If the first instance in which a certain lecturer occurs all boxes on the right are ticked, the second time he occurs but does not tick all boxes his name shows in red but his e-mail doesn't.
I think problem 1 (example 2) is solved if I can get 'both' to somehow mean both 1 and 2, but I don't know how.
I think problem 2 (example 3) is solved if I can get COUNTIFS to ignore the rows is which all five boxes are ticked.
However, I have no clue how to do this. Is anyone able to help me with either (but ideally both) problems?
Thank you in advance!
I'm not entirely sure, but I think I've understood what you need.
For the first part (where a lecturer has less than all 5 subjects containing 'x' AND where E is either the value of cell D1 or the value of 'both'), try this:
Delete both of your existing conditional formatting rules.
Create a new conditional formatting rule for range = C4:C21 (or perhaps further down your sheet to row 977), with a custom formula of:
=AND(COUNTIF($G4:$K4,"x")<5,or($E4=$D$1,$E4="both"))
The style for the rule should have a red background.
For the second part (updated), this is a bit tricker with conditional formatting but I can offer a solution determined by the value of cells, like you had.
Delete the contents of cells M4:N21 (21 being where you have a formula in the furthest cell).
In cell M4, add the following formula:
=arrayformula(if(iferror(if(ifs(E4:E=$D$1,1,E4:E="both",1)+if(G4:G&H4:H&I4:I&J4:J&K4:K <>"xxxxx",1,)=2,D4:D,),)<>"",countifs(iferror(if(ifs(E4:E=$D$1,1,E4:E="both",1)+if(G4:G&H4:H&I4:I&J4:J&K4:K <>"xxxxx",1,)=2,D4:D,),),iferror(if(ifs(E4:E=$D$1,1,E4:E="both",1)+if(G4:G&H4:H&I4:I&J4:J&K4:K <>"xxxxx",1,)=2,D4:D,),),row($E4:$E),"<="&row($E4:$E))=1,))
It might seem a little complex, but it's done this way to use the functions that are compatible with ARRAYFORMULA so that it will keep working down the sheet as far as you have values in rows.
Now create a new conditional formatting rule for range = D4:D21 (or perhaps further down your sheet to row 977), with a custom formula of:
=$M4=true
The style for the rule should have a red background.
I'm trying to create an Excel sheet that will be tracking some of our autonomous processes and their access privileges at my company and I've run into an issue with Excel..
I'm trying to alternate row colors, which in and of itself isn't an issue, however the fact that I've got merged rows are giving me issues.
As of right now I've got 5 columns with headers in A through E. Column F is being used for conditional formatting to color the rows. In column F this formula is present:
=MOD(IF(ROW()=2,0,IF(A2=A1,F1, F1+1)), 2)
This works great if I want to repeat the leading Column item over and over, however I'd like to reduce the visual clutter and increase clarity, so I've merged some of the rows in the Column A because multiple rows in B:E correspond to it.
I've merged A2:A4 right now and the formula picks up the A2 and A4 as blank, but A3 (the text in the merged cell is centered) is recognized as different that A2 and A4 because the text resides there. I'll upload an image to give a better idea of what I'm talking about as well.
If anyone can give me a tip on how to alternate row colors with merged cells/rows that'd be great, I've done a lot of googling and searching on stackoverflow, but for the most part I've only found things that pertain to unmerged rows/cells.
Image Example: https://imgur.com/a/UDbRVWA
=IF() Condition that worked for me:
=MOD(IF(ROW()=2,0,IF((A2=0),IF((OR(A1<>0,A2=A1)),F1, F1+1),F1+1)), 2)
There is an answer below with a picture I posted, however, for most situations I would recommend the method suggested by #BruceWayne. It's far more sensible than working with merged cells!
I ended up finding a solution with just some clever working with the Conditional IF() statements. I think the key was taking into account that the Merged Cells that weren't the top (i.e. If I merged A2:A4, A2 is top, A3, A4 bottom) were equal to 0 while the top was set to the value of the text within the merged cell. Using the formula below I was able to achieve the result I was after:
=MOD(IF(ROW()=2,0,IF((A2=0),IF((OR(A1<>0,A2=A1)),F1, F1+1),F1+1)), 2)
And here is a linked screenshot: https://imgur.com/a/gNaC62c
I then just added conditional formatting for every row but row 1: =$F2=1. I'll be hiding column F to make it seem less obtrusive.
For future reference, I would agree with what #BruceWayne mentioned in that a simpler formatting that gets the job done would be preferable. There are many other ways to format this in a way that makes much more sense, but I felt like I was close when I was tinkering with it, so I stuck with it another 15 minutes or so and was able to pull out a usable formatting condition.
Might I make a suggestion? If the merging rows is to increase clarity with repeated entries, perhaps we can use another Conditional Formatting rule to make it more legible.
Say you have data that looks like this:
But, we don't want to see <Process #> duplicates in the A column. We could merge these cells and center it along the rows. But again, merging cells is generally frowned upon I've found. (It makes it tricky to format, conditional format, copy/paste, do any VLOOKUP()/Index/Match, etc.)
First, let's get the rows alternating colors. I'm using fill of RGB(183, 255, 253):
New Rule 1 -
Formula: =MOD(ROW(),2)
Applies To Range: $A$2:$E$9
Format: Fill with color RGB 183, 255, 253 (...or whatever you want, just note the RGB for later)
Now, we get this:
Okay, making progress. Now, let's work on hiding the duplicate values in column A.
So, let's apply some more Conditional Formats. We'll need two for column A, one to set the font to White, one to set the Font to that blue fill color.
New Rule 2 -
Formula: =AND($A3=$A2,MOD(ROW(),2)=1)
Applies To: =$A$3:$A$100
Format: Font --> Color --> RGB(183, 255, 253)
New Rule 3 -
Formula: =AND($A3=$A2,MOD(ROW(),2)=0)
Applies To: =$A$3:$A$100
Format: Font --> Color --> White
Now we have:
IMO, we can do one more thing to clarify the breaks in Processes:
New Rule 4 -
Formula: =$A2<>$A1
Applies To: =$A$2:$E$100
Format: Border --> Top Border
Now, we have a nice new CF table.
Okay so I'm new to all this- please help me if there's a better way to do this... currently trying to make changes to an existing spreadsheet and I can't figure out how to accomplish what I want...
Tab 1 accounts for different numbers and their assignments, Tab 2 rearranges that data for a printable page, and Tab 3 has a list of all the numbers we have to account for, and currently uses conditional formatting to do so. (Green if the number is accounted for on Tab 1, Red if not)
What I am trying to accomplish is create a list of all the numbers NOT accounted for (Red conditionally formatted cells on tab 3) to show up in any form on Tab 2. I started messing around with the =mycolor and IF functions, but I found that only works with explicit formatting of the cell, not the conditional formatting I am using to account for the numbers.
Do I need to change how my spreadsheet is accounting for the numbers from Tab 1 instead of conditional formatting? If so what would be the best way to go about this? If there's a way to do this with conditional formatting, how would I go about copying data based on the conditional formatting of certain cells?
Also, ideally I want this to be done without having to play a macro. I'm trying to make this as stupid simple for the end user as possible... but if there's no way to do it without recording a macro then that's what I'll end up doing.
Thanks a bunch in advance...
What I would do is add a column to tab three that is a missing/not missing column (=column C in my mock up below). Missing = 1 accounted for =0. (That can either be achieved by the same formula as used to give the red/green OR a vlookup() function). Therefore for each red row there will be a 1 alongside.
Extending that, as per my comment... index the missing values (col A=):
=IF(C3>0,SUM(C$1:C3),"")
Now use a new pair of columns to grab the missing values
And use a lookup function to line up the missing values (col G)... I only went up to 5 (col f)
=IFERROR(VLOOKUP(F3,A$3:B$6,2,FALSE),"")
THANK YOU for your help Richard!
With some changes, the Vlookup function you gave me (in Column E) worked fine:
=IF(ISERROR(VLOOKUP(E2,hiddenradios,1,FALSE)),"1","0")
And adding the second column(s) and the sum function for values was a really helpful idea: (column H)
=IF(VALUE(F2)>0,SUM(G$2:G2),"")
For whatever reason I couldn't make vlookup work, even with the column relocated to the left of the number I was trying to return, but I was able to do the same thing with an INDEX/MATCH formula in column J:
=IFERROR(INDEX(E$2:E$100,MATCH(I2,H$2:H$100,0),1),"")
Not quite as simple as yours, but you set me on the right path with adding column(s) and I wouldn't have figured it out without your help... thanks again!
enter image description here
First time question and I hope it's easier than I'm making this.
Can I use a variable inside a COUNTIF formula?
Currently my formula is:
=COUNTIF($C$2:$C$415,R6)
I would like to have $415 as my variable. I have tried something along the lines of:
D1=415=COUNTIF($C$2:$C$(D1),R6) ..
but obviously get a error.
The reason I need this is column C will constantly be incrementing as I add more rows.
Instead of going into each of my formulas and updated 415 to 416, 417 etc, I would like to just define a Cell that can be my variable, or total rows.
Currently Column C can have blank cells, so I can't have a macro that finds the next empty cell.. but I do however have Column A with a constant populated cell and stops at the last ticket. However Column A is unrelated to the COUNTIF.
UPDATE 1
I'd also like to mention that I'd be using this variable in many formulas in the spreadsheet. Not only COUNTIF's. Also, the COUNTIF contains text.
UPDATE 2
Actually, I figured it out! I am using this formula instead:
=COUNTIF(INDIRECT("C"&D1&":A"&D2),R6)
I'm putting D1=2 and D2=415 and will just update cell D2 with how many rows I have.
I guess I just needed to ask the question thoroughly to fully understand what I wanted!
Thank you in advance for all help, tips and suggestions.
Would "=COUNTIF($C:$C,R6)" do the trick? This will apply COUNTIF to the whole of column C. It's an easy solution, but probably not the most efficient.
I prefer tables for storing data; as new data is added, the table automatically expands and the columns are already labeled (much like Named Ranges). Then you can have =COUNTIF(Table1[Column1],"Criteria"), which will encompass any new rows added to the table automatically. Especially helpful if you have multiple tables in the same column.