tcpdf multicell() and column break - tcpdf

I have a MySQL code which people list up x amount of information and this goes in two columns. I have grouped these people in departments and there is a department header for each on the page.
I would like to break the column and start from the top again when the department would not fit in the same column.
Have anyone experienced the same issue? Any help would be appreciated:)
thanks

I just ran in to the same issue, and I dealt with it by checking my current position in the page. If the position is too low in the page for the content that I know will be there (and thus flow to the next column) I select the next column before outputting. Here is a sample of my code:
if ($tcpdf->GetY() > 188)
$tcpdf->selectColumn($tcpdf->getColumn() + 1);
$tcpdf->writeHTMLCell(120, 3, $tcpdf->GetX(), $tcpdf->GetY(), $html, '', 1);

Related

Top 20 spending category FORMULA

I'm using Google Sheet for a annual badget tracking.
I'm trying to figure out how sort 20 top categories from a specific range (categories and prices) but i get an error all the time and i can't understand what i'm doing wrong.
This is my formula and where I stuck:
=SORTN(UNIQUE(FILTER(FLATTEN(P21:P40,W21:W40,I46:I65,P46:P65,W46:W65),FLATTEN(P21:P40,W21:W40,I46:I65,P46:P65,W46:W65 <>"")),20,0,FILTER(FLATTEN(T21:T40,AC21:AC40,N46:N65,T46:T65,AC46:AC65),FLATTEN(P21:P40,W21:W40,I46:I65,P46:P65,W46:W65)<>""),0,1,1)
seems the problem coming from the second part:
FILTER(FLATTEN(T21:T40,AC21:AC40,N46:N65,T46:T65,AC46:AC65),FLATTEN(P21:P40,W21:W40,I46:I65,P46:P65,W46:W65)<>""),0,1,1)
This is the error i got:
Error
FILTER has mismatched range sizes. Expected row count: 60. column count: 1. Actual row count: 100, column count: 1.
Could please anyone help me?
I think your formula should have been
=SORTN(UNIQUE(FILTER(FLATTEN(P21:P40,W21:W40,I46:I65,P46:P65,W46:W65),FLATTEN(P21:P40,W21:W40,I46:I65,P46:P65,W46:W65 <>""))),20,0,FILTER(FLATTEN(T21:T40,AC21:AC40,N46:N65,T46:T65,AC46:AC65),FLATTEN(P21:P40,W21:W40,I46:I65,P46:P65,W46:W65)<>""),0,1,1)
I can't prove this definitively without test data, but the missing 40 rows are almost certainly because your sheet only goes up to column Z so AC21:AC40 and AC46:AC65 aren't included. If you insert more columns to the right without changing the formula, the error goes away.

Google Sheets: How Do I Colour A Cell Based On Whether Its Number Be Found in Running Column Ranges of Different Tabs

https://docs.google.com/spreadsheets/d/1bLmL6E0odCB4aKBBZWqUeoyEYxKphmInL9wS6lsKQr8/edit?usp=sharing
I'm trying to create a heads up display on the number of Hints a user has collected in a contest.
There are different categories of hints here.
So I'm trying to create a process such that in the respective Category tab (ie AREA / SUBZONE in this case)
Filling in Column B (with the hint number), renders that Hint as being "obtained" and hence showing up "Green" in my Hints Overview sheet.
The problem I'm trying to solve is users are going to collect Hints and classify them by Category. Thus the example hint of BH169 can be present in any of the Category sheets below.
How do you write conditional formatting in Google Sheets to iterate through a given set of ranges for a match of "169" from the Hints Matrix in Dashboard with that of "BH169" in the Hint # column?
I tried pulling some conditional formatting tricks like indirect(), Index(), VLOOKUP. Alot of nested functions within each other but nothing worked out.
Here are some functions I've tried. Now I've entered into a mental block not sure what else I can approach the problem.
INDEX(VLOOKUP(D8, {ROW(INDIRECT("BONUS!B2:B"))-1, INDIRECT("BONUS!B2:B")}, 2, 0))<>""
INDEX(VLOOKUP(D8, {INDIRECT("AREA / SUBZONE!B85:B124")), INDIRECT("SPOT (GENERIC)!B85:B204")}, 1, 0))<>"D8"
INDEX(VLOOKUP(D8, {INDIRECT("AREA / SUBZONE!B85:B124")}, 2, 0))=D8
INDEX( VLOOKUP (D8, { ROW ( INDIRECT(" 'AREA / SUBZONE'!B85:B124") ) }, 2, 0) )<>""
MATCH(D8, {INDIRECT("AREA / SUBZONE!B85:B124")), INDIRECT("SPOT (GENERIC)!B85:B204")}, 1, 0))=D8
The condition formatting is done in Dashboard
Would appreciate some advice and tips. Thank you!

Return most recent results with multiple criteria

I would like to find the most recent three results (front top to bottom) in a Google Sheet where column L is "Signed" and the result (column T) is not 0 or blank.
I have the below so far which gives me the first result but not filtered by column L and not excluding 0 or blank cells.
=ARRAYFORMULA(IFERROR(INDEX('Print List'!T$2:T,SMALL(IF("Alex"='Print List'!A$2:A,ROW(A$2:A)-1),1))))
(edit: or rather than ignoring 0 or blanks - column F must be "Sold" so could also filter by that.)
I need to display the results for 1st, 2nd and 3rd in separate columns so will replace the 1 at the end of the above with appropriate number.
Hope I have explained myself ok and any help received will be greatly appreciated.
You might try this off to the side somewhere, or on a different tab, where I assume your tab name is Sheet1:
=TRANSPOSE(QUERY('Print List'!A:T,"select T where T>0 and L='Signed' limit 3"))
After a bit more digging I have got it to work! Thanks Matt for pointing me in the right direction.
=IFERROR(INDEX(ARRAY_CONSTRAIN(QUERY('Print List'!A:T,"select T where A='"&$A2&"' and T>0 and L='Signed'",0), 1, 1), 1),"")
EDIT: Improved again using Matt's edited suggestion:
=IFERROR(TRANSPOSE(QUERY('Print List'!A:T,"select T where A='"&$A2&"' and F='Sold' and L='Signed' limit 3","")),"")
Thank you.

EXCEL VLOOKUP/MATCH/VARIABLE

Good Evening and thanks in advance for taking the time to read and help.
I have a 3 column excel file which I am trying to populate the 3rd column with a return value found next to the row its found in.
so for example I want to look at column MANAGERSFULLNAME for value
Cheryl Rommelfanger and find the match in column FULLNAME. Once the match is found I want to populate MANAGERSX2FULLNAME but not with the value found in FULLNAME but with the value next to in column MANAGERSFULLNAME
So for this example we look in MANAGERSFULLNAME for Cheryl Rommelfanger and find the match in FULLNAME Cheryl Rommelfanger then populate MANAGERSX2FULLNAME with
William Dearth
FULLNAME MANAGERSFULLNAME MANAGERSX2FULLNAME
Dena Peters Cheryl Rommelfanger
Kyle Marsh Melissa Hall
Cheryl Rommelfanger William Dearth
ive tried a few things and can only get a count not the value next to it.
=MATCH($E2&$F2,INDEX($B2:B4000&$C2:C4000,),)
=IF(ISERROR(MATCH(E2,F2,$B$2:B$4000,$C$2:C$4000,0)),"",E2)
=IF(ISERROR(MATCH(L2,$K$2:K$4000,0)),"",L20)
any help would be greatly appreciated.
So I apologize but I am having a bit of trouble understanding your columns, but the general idea is clear.
Your attempts are really close. You want to use index(match) as opposed to match(index). The link below describes how to do this.
Index match formula
If I'm understanding you correctly it sounds like you're trying to find and list the bosses boss so-to-speak to display a hierarchy of sorts. I'm using just columns A, B, and C (C being the managerx2fullname) this formula should work fine:
=index(B$2:B$4000,match(B2,A$2:A$4000,0))
You will of course need to change the columns to fit your needs. Don't include a dollar sign in B2 because you want this to increment as you drag the formula down the column. The link below shows a screen shot from my test. In it we see that in row 2 John is Adams boss, who in turn is Joe's boss. I think that's what you're shooting for here.
Screen shot

SQLLite SQL statement to find first non-zero of multiple columns

I have 2 rows in a table. Each row contains a primary key, and 5 additional columns, whose value may be 1, or 0.
So for example one of the columns is "TermsAccepted" and another is "CopyrightAcknowledged"
Row 1's "Terms Accepted" might be 0 or 1, and row 2's "Terms Accepted" might be 0 or 1 as well.
I'd like to know if at least one of the rows contains a 1 for each column. Do I have to use 5 subqueries to do this (I'd like to just have one row returned that tells me if any of the columns have 1's in them). It doesn't matter to me how many had 1, just so long as at least one column did.
Hopefully that made sense. How could I write a query to do this? I'm using SQL Lite. I'm somewhat stuck. Thanks so much!
Note: I can just return both records, and then use Swift (the programming language i'm doing this in) to just parse each column in each row and look for a 0 or a 1, but I was hoping for something in SQL to make it more elegant if possible.
I think this should work but if anyone could confirm that would be great, thanks!
SELECT
max(TermsAccepted),
max(CopyrightAcknowledged),
max(LoggedIn),
max(LockedOut),
max(AccountCopied)
FROM MyTable

Resources