I'm struggling to write an excel macro or formula to work out differences in columns and would really appreciate if some kind person could help me out:-
See spreadsheet attached.
I need to do the following calculation.
Work out the figure for Column H minus Column E then if this figure is less than Column A i need to highlight the row in Yellow.
Thanks Anhn, unfortunately i tried your formula however it returns FALSE in the rows that have blanks....i need it to output no word (True or False) in those rows with blanks.
Sorry to be a pain. I really appreciate your time.
Thanks Anhn, unfortunately i tried your formula however it returns FALSE in the rows that have blanks....i need it to output no word (True or False) in those rows with blanks.
Sorry to be a pain. I really appreciate your time.
Follow these steps. i am using your workbook as a reference...
Click on cell E4
Click on tools format=>Conditional formating
Select "Formula is" in Condition 1
type
=AND($H4-$E4<$B4,LEN($E4)>0)
in the textbox next to it. after that click on the format button. Under the patterns tab, select Yellow. and click ok.
Now click the format painter button from the tools, and paint the rest of the cells down. The cells will automatically be conditionally formated.
Hope this helps...
If I misunderstood your query, then do explain it to me again and I will try and help...
Edit: I am attaching a copy of your workbook where the cells are conditionaly formated...
Last edited by Siddharth Rout; Jun 20th, 2008 at 05:51 AM.
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread "Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
Thanks for your time. However the cells which are blank in columns H and Column E should output nothing i.e leave the cell White.
Instead the conditional formula outputs the word FALSE if the cell is blank.
How do i get it to output nothing?? i.e. leave the cell White / Empty
What? Conditional formula must return either TRUE or FALSE. If TRUE then set background to Yellow, otherwise leave it as default.
You won't see any value TRUE/FALSE from Conditional formula.
Last edited by anhn; Jun 20th, 2008 at 09:04 AM.
Don't forget to use [CODE]your code here[/CODE] when posting code
If your question was answered please use Thread Tools to mark your thread [RESOLVED]
I was copying the cells instead of filling the cells with the formula.
thanks for all your help
If you would have gone through what I mentioned above, you would have seen that you could have used the format painter to do the job. you don't need to put the formula manually
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread "Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
No need to know how to use format painter.
Highlight Data range A4:H25 starting from A4, enter Conditional Formula just once as:
=AND($H4>0, $E4>0, $H4-$E4<$B4)
for cell A4. All other cells will have Conditional Formulas updated with their row numbers automatically.
Don't forget to use [CODE]your code here[/CODE] when posting code
If your question was answered please use Thread Tools to mark your thread [RESOLVED]
No need to know how to use format painter.
Highlight Data range A4:H25 starting from A4, enter Conditional Formula just once as:
=AND($H4>0, $E4>0, $H4-$E4<$B4)
for cell A4. All other cells will have Conditional Formulas updated with their row numbers automatically.
Yup that's another way to do it...
The third way to do it would be to copy cell A4 after the conditional formating is done AND then do a "pastespecial-Formats" on the rest of the cells.
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread "Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero