Consulting

Results 1 to 2 of 2

Thread: Problem about function reference

  1. #1

    Problem about function reference

    Dear all member!
    I was studying the application functions in Excel.
    Currently I have a cell that says "number of cars:2".
    I want to write something that makes it so that if the number of cars is less than 2, turn the cell red.
    If it is greater than 2, turn the cell green.
    Is there a way to reference just the number in the cell when writing an if statement.
    If I can, how would I do so?


    Thank's a lot!
    Chúng tôi cộng đồng internet việt nam website https://internetvietnam.net/https://dulichviet.net.vn/https://jobs.drupal.org/company/15207 sự lựa chọn tốt nhất khi khách hàng một cách hiệu quả.

  2. #2
    VBAX Tutor TheAntiGates's Avatar
    Joined
    Feb 2005
    Location
    Tejas
    Posts
    263
    Location
    A better practice would be to use separate cells for description and for quantity. Text in one cell, "number of cars:", and the value 2 in another cell, such as the cell below or to the right.

    If they must be combined as you describe, it is more difficult to process and maintain that. One way would be to identify the common rule of data. For example, with these cells in A1:A4
    number of cars:2
    number of cars:1
    number of boats:1
    number of bikes:2
    If the "rule" is that the number follows the colon (":"), and there is never more than one colon, you might go
    B1=value(mid(a1,find(":",a1)+1,99))
    and copy down. However this type of approach with data can commonly lead to inconsistency and maintenance problems because the "rule" must be adhered to. So it's better to use separate cells.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •