ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Calculate a sentences width based on lookup (https://www.excelbanter.com/excel-worksheet-functions/454964-calculate-sentences-width-based-lookup.html)

Phil Delaney

Calculate a sentences width based on lookup
 
Hi,

I have a spreadsheet made up of 2 columns. The first with lower case characters a-z and following that upper case A-Z, then following that numbers 1 through to 0, then a few punctuation marks and a blank (space). In the second column is a reference to the px width of each character.

We want to be able to take a given sentence in a cell and calculate the width of all the characters and when this hits an X limit, break the line (second line) and then calculate the remainder, but break again for a third or fourth line (with different X values). There may be 1, 2, 3 or 4 lines in total.

jerry_maguire

Countif
 
When you just want to determine if a value exists in a list then I recommend using COUNTIF over VLOOKUP. ... VLOOKUP cannot do this, it only returns the first match. If the value does not exist, COUNTIF will return a zero (0). You do not need to worry about a formula error.

Regards,
Jerry


All times are GMT +1. The time now is 12:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com